py: Make a function static; replace NULL with MP_OBJ_NULL.