While reviewing #18053, @seberg mentioned
if really would be nicer if sop would just have a return value IMO. Then we could avoid the whole PyErr_Occurred() check
This would involve refactoring the declaration and many of the functions definitions, and then fixing the actual code that calls these.