CLN: cleaned up _try_cast in core/groupby.py to eliminate cruft (GH3920)