CLN: revisit build warnings in cython templates
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

Retrying dropped portions from #27157, which amend cython templates, to deal with special-cases based on type. In this Pr, compiler warnings about  `x==x` being useless in the case of ints, but not floats (since `nan!=nan`).

In https://github.com/pandas-dev/pandas/pull/27157#discussion_r299103166 these were rejected because there wasn't agreement about how this should done and a separate discussion was requested. Annoyingly, these changes agree with what already exists in these files (in multiple places):

https://github.com/pandas-dev/pandas/blob/355e322b5ed4a31c9e1cab9652510e85a54f23a3/pandas/_libs/groupby_helper.pxi.in#L212-L216

But the file is already inconsistent in how these type checks are done:

https://github.com/pandas-dev/pandas/blob/355e322b5ed4a31c9e1cab9652510e85a54f23a3/pandas/_libs/groupby_helper.pxi.in#L391

Making a decision here also required to get rid of the warnings mentioned in https://github.com/pandas-dev/pandas/issues/27169, in that case fused types which mix signed/unsigned trigger warning when the code later includes comparisons with a signed quantity. So there too, type checks in the template are the obvious fix.

cc @WillAyd, @jreback 

I'm not really sure this is an improvement as it just adds more layers to the templating where we already have a weird mix between templates and fused types. Is there a way to just do this all using fused types perhaps? actually i think these changes are ok, though can you have a look and see how consistent we are with these idioms across cython? is there a way to centralize these templates (easily)? e.g. have a is_null type of template > is there a way to centralize these templates (easily)?

maybe, I'll try it. But then, what would to do with the signed/unsigned compares in #27157? ok this is positive progress towards reducing warnings.