Replacing distutils.ccompiler.get_default_compiler

While trying to purge distutils from my projects, there’s just one thing that I haven’t found a suitable alternative for:

def test_longdouble_precision_improved():
    # Just check that this can only be True on windows, msvc
    from distutils.ccompiler import get_default_compiler

    if not (os.name == 'nt' and get_default_compiler() == 'msvc'):
        assert not longdouble_precision_improved()

It’s not terribly important, but the context is a function that detects weird behavior on MSVC, but we want to verify it is never encountered in other environments.

Is there a recommendation of how to do this that will survive the final removal of distutils?