As noticed in in bug 1218576 comment 49 and referenced again in bug 1304494, having to pre-allocated every keyedhistogram for each process type is kinda silly. Especially since it's primarly due to some code structure choices in TelemetrySession.jsm which can likely be changed. We can almost certainly do better.
I think the proper way to fix this is to fix our snapshotting. We only use snapshotting of individual keyed histograms in tests and for the ping assembly in TelemetrySession.jsm. Both could instead use a proper snapshotting API for keyed histograms: one function to snapshot all keyed histograms, potentially filtered by process type etc.
Once we handle this properly, we can remove the workaround here: https://dxr.mozilla.org/mozilla-central/rev/9baec74b3db1bf005c66ae2f50bafbdb02c3be38/toolkit/components/telemetry/TelemetryHistogram.cpp#2001
Fixed by bug 1366294