This function should probably be wrapped in a `try` ... `catch` to ensure that Py_DECREF(z) is called.  It seems unlikely an exception would get thrown here, but a future change may introduce something that could.