Fixed #21573 -- Improved performance of utils.text.normalize_newlines.