These are both simple functions that serve the same purpose. Py_NewRef didn't exist when Py_INCREF_RET was added to Blender.
generic
NOTE: `bgl.h` was left unchanged, as it is deprecated code anyway, and its conversion to C++ does not seem immediately trivial.