MAINT: add code and tests to deal with sqrtm of some singular or otherwise weird matrices