TYP: Fix core/groupby/generic.py type ignores
xref #37715

Two things to mention:

- not a huge fan of casts but couldn't find another way to fix the issues;
- added `Index()` in line 277 because `columns` attribute of a dataframe is supposed to be of Index type.
After reviewing all the comments it seems that the only change that can be applied at the moment is `cast` from line 648. Given that in general it is better to omit such, would you prefer me to still go with this one change, or should I close this PR and come back to it after e.g. stubs are merged? Thanks @FactorizeD can you get this PR into a mergeable state (and not marked as draft) even if only the one change. can you merge master and fix the precommit