Replace is_temporal checks with Cython version
With Cython 3.0.3 I was unable to build pandas. Looks like is_timedelta / is_datetime functions were getting mixed between static / non-static declarations. I wasn't sure why that was happening, but while investigating noted that these got ported upstream by @jbrockmendel a few years back, so I think it makes sense to leverage that instead (also clears the issue)
Does this affect our minimum cython/numpy versions?  (IIRC cython has a `numpy/__init__.pxd` file that got used sometimes and they wanted to get rid of it but i dont know if that ever happened or what versions are affected) Would this allow us to unpin our Cython `<3.0.3` in our CI files? As long as you're doing these, might as well change to use the other stuff upstreamed into numpy in numpy/numpy#16266? > Would this allow us to unpin our Cython `<3.0.3` in our CI files?

Ah didn't realize we pinned that. I believe so; at least locally I can build the entire code base with this > As long as you're doing these, might as well change to use the other stuff upstreamed into numpy in [numpy/numpy#16266](https://github.com/numpy/numpy/pull/16266)?

Unfortunately there is a problem where the definition we have of `NPY_DATETIMEUNIT` in pandas._libs.tslibs.np_datetime differs from what Cython offers, the main difference being the Cython version does not offer `NPY_FR_GENERIC` as a value. Our code does some comparison to that value, so we can't swap over to using `get_datetime64_unit` because Cython/C will not be happy with the difference in those enum declarations

I think that's a bug in Cython - the source file `numpy/ndarraytypes.h` does have an enum member for `NPY_FR_GENERIC` so probably just needs to be upstreamed in Cython before we can fully implement your PR @jbrockmendel see also https://github.com/cython/cython/pull/5765/files > With Cython 3.0.3 I was unable to build pandas. Looks like is_timedelta / is_datetime functions were getting mixed between static / non-static declarations. I wasn't sure why that was happening, but while investigating noted that these got ported upstream by @jbrockmendel a few years back, so I think it makes sense to leverage that instead (also clears the issue)

This was a bug in Cython, but I'm happy to see that this fixes it. OK I updated the enum definition upstream in https://github.com/numpy/numpy/pull/24923#event-10675144378 so can come back around for the rest of these when that goes through. Any concern with this PR in its current state? I'm OK with the fix. Could you also unpin Cython 3.0.3 in our files? #55582.

I think we can unpin generally anyways since Cython 3.0.4 is out. Thanks @WillAyd  nice!