I am not sure if there will be a consensus to merge this but let me give feedback to help

doing this will break on sparse data.  Maybe preventing normalize on sparse data is the way to go.
Also if X has already been copied you should write

X -= X_mean
X /= X_std

this will prevent a reallocation of the size of X.