This will call hasattr for every object (dict, list, string, tuple, int, ...) that's being json encoded. Do we use `__json__` anywhere? It's a lot cheaper to just keep everything to Python base types.