The manual doesn't indicate the specific change (this is one area of weakness for the language), but hash_hmac already no longer does what you're talking about: passing a non-string there is a TypeError since 8.0.
Increased strictness in the types that can be passed to the built-in functions has been a general area of focus for the last several versions.