Python 3 'json' module is actually corrupted
Well I suppose I will deal with &quot;glib, graphviz and gts&quot; 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 &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&gt;&gt;&gt; import json
&gt;&gt;&gt; d = {'a' : 100, 'b' : 200}
&gt;&gt;&gt; json.dumps(d)
'{&quot;a&quot;: 100, &quot;b&quot;: 200}'