This is interesting to know, because Julia uses exactly the same approach[1] (now I know where it comes from). To me it seems to be the ideal solution: use the in-place normalize!(X) where performance is important, otherwise use the more convenient allocating variant normalize(X). The exclamation mark makes it clear that the array is modified.
[1] https://docs.julialang.org/en/v1/base/collections/#Base.sum!