Expanding windows are the correct default for anything that should use all available evidence without seeing the future: a cumulative mean, a running percentile rank, a normalisation constant applied to live data.
The danger with the alternative is subtle. If you standardise a whole series using its full-sample mean and standard deviation, every early observation has been scaled using numbers from the future. That is look-ahead-bias hiding inside a preprocessing step, and it is one of the most common silent bugs in research code.
Example: ranking today's volume against the expanding history of volumes is legitimate; ranking it against the whole dataset including next year is not, and can flatter a backtest by a surprising amount.
Related: rolling-window, look-ahead-bias, anchored-walk-forward