+from weakref import WeakKeyDictionary
This isn't a new bug, but it's exposed by always importing weakref and atexit during interpreter startup. I'm wondering if that's really necessary :)
We can easily move the import inside singledispatch but I would much rather try fixing the actual bug. What do you think?