Description
Functions are added to the stable ABI over time, and just given the C definition of a module, auditing to see what function calls are stable and what aren't is not trivial.
I think the core issue is that there is only one header that all functions are supposed to be defined in, which is Python.h
I think the stable ABI could be defined in another header, PythonABI.h,
where Python.h includes PythonABI.h for compatibility reasons.
Taking this further, we can have a PythonABI1.h, PythonABI2.h, PythonABI3.h, etc, and Python.h includes the latest one, while modules that want to target a specific ABI with long-term guarantees can directly pick one of these.
Now, to make sure you only use the stable ABI, or which stable ABI, you need only look at the include block at the top of the module.
I'm not sure how feasible this is, but I think it is worth doing.