Move ndobject_from_ptr to the lowlevel py_api struct