The C-APIs of different Python implementations (as well as the one of Numpy) are rather hot topics at the moment, though only to the initiated. This is where currently significantly more development happens than in the actual Python language. The HPY-project is attempting to standardize the C-API across multiple implementations of Python, e.g. CPython and PyPy, and explores paths to adopt it in Numpy. All of those solutions have in common that the documentation, while certainly detailed, is not particularly beginner-friendly. Numpy's documentation goes, for the lack of any examples and meaningful explanation of concepts, as far as to advise the reader to read the Numpy source code.
Let's explore some minimal examples of building C extensions with different means and, first and foremost, HPY.
- https://docs.python.org/3/c-api/index.html
- https://numpy.org/doc/stable/reference/c-api/index.html
- https://hpyproject.org/