Efficiently computing eigenvalues and eigenvectors in Python