Add support for Cython3, because Cython < 3 does not work for py3.13. Add support for py3.13. Fix issues discovered along the way.
Please see individual patches for details.
/cc @tomo, @jerome