The type annotations in the definition of the `bson.json_util.loads` function is incorrect. It says the function only accepts `str`. But, since it delegate it's implementation to the Python standard library `json` module, it in facts allows decoding `str`, `bytes` and `bytearray` (cf. documentation).
Note that forcing user to pass a str could have a negative impact on performances. I didn't do any benchmarks yet.