Refactored custom datetime functions
Takes some of our custom code out of the vendored numpy module and puts it in a capsule. date_conversions.c is custom and could argue it should entirely be put into the capsule, but didn't want to do that here.

The main motiviation is to make the work @jbrockmendel started in https://github.com/pandas-dev/pandas/pull/51368/ possible

Thanks @WillAyd  @jbrockmendel do you want to try #51368 again? I think the code you had there should translate perfectly into this My current thought/hope is that numpy will merge https://github.com/numpy/numpy/pull/21199 and we'll get this function from them. If that falls through then I'll revisit #51368. Sounds good. Just keep in mind with that approach you won't ever be able to do what you were trying to do with using the DateTime API directly, so will just stick with the duck typing