Right, I modified the implementation of functions related to reference counting to implement these functions as “opaque function calls”: Py_TYPE() and Py_REFCNT() are opaque function calls in limited C API 3.14.
Would it be a reasonable workaround for you to build your C extension on a recent Python version?