Ok I’m now more certain of this hypothesis - we are missing the final two fields from the Python type struct here: cpython/Include/cpython/object.h at 9363703bd3bf86e363c14a02e3d729caf1e29f44 · python/cpython · GitHub
And specifically tp_versions_used, which caused the bug above, is the final (missing) field. It must have been added in Python 3.13.