improve performance of var and std by streamlining input checks, reducing repeated function calls, and structuring condition checks to reduce overhead.
replace expensive calls to cast, repmat, and shiftdim with alternative vector replication calls.
improve handling of matrix and vector inputs and weights.
ensure single class preservation in shortcut paths.
update docstrings to match expected behavior.
use variable names matching docstring names.
add tests as needed for items above.
NOTE: did not streamline redundant tests from statistics and core.