Summary
RUF055 does not trigger when the regex contains a byte string playground
re.sub(rb"x", b"y", b"x")
This could be replaced with
b"x".replace(rb"x", b"y")
I'm unsure if every string replacement would also work for byte string replacement, or if there would be some exceptions.
Version
playground