Yes, ``hmac.compare_digest`` is constant time (assuming the strings are the same length, and if they aren't then it will only leak the fact that they are different in length). See https://docs.python.org/3/library/hmac.html#hmac.compare_digest