This should probably be msg_to_dict instead since the output is not actually JSON (which should be a str), but a dict decoded from JSON metadata.
Originally posted by @uranusjr in pypa/pip#11095 (comment)
I tend to refer to the type as "JSON-compatible dict", which is too long for a method name. But dict is probably better than json as an abbreviation.