PyLong_Type raises an exception if the argument is not convertible to long, therefore, this has to be handled as new_reference and not new_non_null_reference, otherwise a segfault will occur.
str::endswith()