MAINT: more carefully preserve dtypes through sqrtm when possible, with tests