While returning structs makes for a nicer C API, it doesn't necessarily map cleanly and obviously to the ABI.
Which can make it tricky to use from Rust, or other languages.
Different architectures and compilers have different ways of returning structs, whereas returning scalars is much more regular.
Therefore we should change
PyResult foo(int arg);
to
int foo(int arg, PyRef *result);
This will be a bit slower in some cases, but may be faster in others.
While returning structs makes for a nicer C API, it doesn't necessarily map cleanly and obviously to the ABI. Which can make it tricky to use from Rust, or other languages. Different architectures and compilers have different ways of returning structs, whereas returning scalars is much more regular.
Therefore we should change
to
This will be a bit slower in some cases, but may be faster in others.