Changeset 9cac2ec83346 addressed the first bug uncovered by issued #144. This changeset addresses the other problem, with exporting of the Pygame C api.
This changeset makes the PyGAME_C_API array a C global for each extension module, with the main declaration in the C file that imports a Pygame api, by including pygame.h, and extern in any other C source files which include _pygame.h instead.
Explanation of the originally reported bug:
The _freetype extension module is defined over several C source files. The Python level interface is defined in _freetype.c, which imports other Pygame extension modules for their C apis. The other freetype source files are defined in the src/freetype subdirectory. They also access the Pygame C api. Unfortunately, the Pygame C api pointer array PyGAME_C_API was declared as static, giving each C file its own copy of the array. Only the array local to _freetype.c was initialized; the other instances had undefined pointers. In the _PGFT_Render_NewSurface of file ft_render.c, SDL_CreateRGBSurface returned an SDL exception, because the surface width and height values were too large (due to the bug fixed in changeset 9cac2ec83346). A NULL pointer in the PyGAME_C_API entry for PyExc_SDLError meant the PyErr_SetString call failed to set a Python exception. So _PGFT_Render_NewSurface, and subsequently the freetype.Font.render method, returned a NULL object without an exception. Python raised a SystemError as a result.