BUG: Prevent abuse of kwargs in stat functions
Addresses issue #12301 by filtering `kwargs` argument in stat functions to prevent the passage of clearly invalid arguments while at the same time maintaining compatibility with analogous `numpy` functions.
