Modernize the fix for #10043
- [ ] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

This fails for non-writeable `object` NumPy arrays as they cannot be declared as `const` in Cython. This leaves us with either the case that we don't support them or that we reject this PR again. hmm, that's annoying. so we still the the work around but only for ``object``. you could leave the workaround in place and use the const keyword for non-object. i suppose that's an improvement. > This fails for non-writeable object NumPy arrays as they cannot be declared as const in Cython. 

Do you know if that is an inherent limitation, or something that can be improved in Cython? (in which case we should report this there) Looking a bit deeper into this, I think this could be a limitation of Cython but I'm missing the necessary background knowledge, thus I opened a bug: https://github.com/cython/cython/issues/2485 closing as pending a cython fix :<