Cython 3.0 faster maybe_convert_objects
Since mask is a PyObject Cython 3.0 tries to do setting using the mapping protocol, which causes some slowdowns in tight loops.

This probably should have been cdef'ed to begin with anyway though
Thanks @WillAyd 