bpo-40522: Use PyThreadState_Get() in _lsprof.c by corona10 · Pull Request #24596 · python/cpython
In commit 6207810, I wanted to clarify that the function is used in practice rather than the macro in public Python header files. But in _lsprof, I suggest either to leave it unchanged, or switch to faster _PyThreadState_GET() which is always inlined.