WIP: bpo-35059: _PyThreadState_GET() checks that the GIL is hold by vstinner · Pull Request #10278 · python/cpython
Convert _PyThreadState_GET() and _PyInterpreterState_GET_UNSAFE()
macros to static inline functions, and the functions now check that
the GIL is hold.
Add _PyThreadState_GET_UNSAFE(): similar to _PyThreadState_GET(), but
don't check that the GIL is hold.