I had this idea while reading psf/black#4522 when @MichaReiser said ruff had already stabilized hex code formatting.
I don't actively use ruff/am not familiar with it, but I assume that just like black formatting code should not have an observable runtime effect.
playground link formatting f"{r'\xFF'=}" gives f"{r'\xff'=}"
>>> f"{r"\xFF"=}"
'r"ÿ"=\'\\\\xFF\''
>>> f"{r"\xff"=}"
'r"ÿ"=\'\\\\xff\''