Limited C API: implement Py_INCREF() and Py_DECREF() as function calls

FWIW, I have never been a fan of the cross-version ABI stability idea. Many of the top used Python extensions want performance and thus need to be compiled per version. The added confusion around the various API subsets doesn’t really pay off, if they are only used by a handful of less used extensions. With today’s CI/CD pipelines, creating distributions for the common set of targets is not hard anymore (as it was when Martin kicked off the idea) and tooling in that area is getting better all the time as well.

I very much want to use a stable ABI for my (proprietary) extension. Building it for two versions of python was extremely painful in the past, and extending that to 3.8, 3.9, 3.10, and 3.11 is the sort of pain I really don’t want. There may be perfectly good solutions for building multiple wheels for different versions when what you what you are producing is “an extension”, but when you have an existing build system for an existing (fairly large) product incorporating those is likely to be hard.

Using the stable ABI makes my life very much simpler (and the performance difference between the stable ABI and the version-specific ABI is trivial for us.)

2 Likes