I would write it in two lines
    
    X_flat = X.ravel(order='F' if np.isfortran(X))
    return np.dot(X_flat, X_flat)

I thinks this makes sense as we are optimizing things and it saves one function call