Python 3 'json' module is actually corrupted

Well I suppose I will deal with "glib, graphviz and gts" later, but what did the trick for me was to entirely remove the brew installation of Python 3:

brew uninstall --ignore-dependencies python3

And now things are back to normal:

$ python3
Python 3.7.3 (default, Apr 24 2020, 18:51:23) 
[Clang 11.0.3 (clang-1103.0.32.62)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import json
>>> d = {'a' : 100, 'b' : 200}
>>> json.dumps(d)
'{"a": 100, "b": 200}'