PyObject_GetBuffer can still throw exceptions, so this is still required.