_Py_CheckRecursionLimit variable is no longer needed and can be removed.
In Python 3.9, I added a recursion limit per interpreter.
In Python 3.8 and older, it was used by _Py_MakeRecCheck() macro to check for recursion error.
Previously, the _Py_CheckRecursionLimit variable was kept for backward compatibility with the stable ABI, but in Python 3.8 and older, Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() could not be used with the limited C API since these macros accessed PyThreadState structure member, whereas the structure is opaque in the limited C API.
bpo-40513: Per-interpreter recursion_limit (GH-19929)
Move recursion_limit member from _PyRuntimeState.ceval to
* Py_SetRecursionLimit() now only sets _Py_CheckRecursionLimit
of ceval.c if the current Python thread is part of the main
* Inline _Py_MakeEndRecCheck() into _Py_LeaveRecursiveCall().
* Convert _Py_RecursionLimitLowerWaterMark() macro into a static
(2) bpo-38644: The _Py_CheckRecursionLimit variable was used by Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() macros. I converted these macros into function calls in Python 3.9:
bpo-38644: Add Py_EnterRecursiveCall() to the limited API (GH-17046)
Provide Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() as
regular functions for the limited API. Previously, there were defined
as macros, but these macros didn't work with the limited API which
cannot access PyThreadState.recursion_depth field.
Remove _Py_CheckRecursionLimit from the stable ABI.
Add [Include/cpython/ceval.h](https://github.com/python/cpython/blob/main/Include/cpython/ceval.h) header file.
In pycore_ceval.h, the function is overriden by a macro which points to an inline function which uses:
tstate->stackcheck_counter (if USE_STACKCHECK macro is defined)