But it does not have a function to use libc-style password hashes, so that doesn't help.
Unfortunately a lot of that old crusty shit is still in production in many places, despite being EoL for years, with no plans to replace it this side of 2038.
>>> from ctypes.util import find_library
>>> find_library("c")
'/usr/lib/libc.dylib'
>>> from ctypes import cdll
>>> libc = cdll.LoadLibrary(find_library("c"))
>>> import ctypes
>>> libc.crypt.argtypes = [ctypes.c_char_p, ctypes.c_char_p]
>>> libc.crypt.restype = ctypes.c_char_p
>>> libc.crypt(b"toomanysecrets", b"az")
b'azi4LBG1VJohQ'
Here is what Python's own _crypt does: >>> import _crypt
>>> _crypt.crypt("toomanysecrets", "az")
'azi4LBG1VJohQ'