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

raised on #3920