ENH fast squared Euclidean/Frobenius norm helper function