ENH: Support mask for groupby var and mean
- [x] xref #37493 (Replace xxxx with the Github issue number)
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [x] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [x] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

This saves around 30-35% in the aggregation operation for nullable dtypes with 1/3 missing values compared to the previous implementation

cc @jorisvandenbossche 
Thx for review @rhshadrach 