Would there be any way to inject such formatting in by messing with the interpreter at runtime? I assume it would be possible to get as far as "works most of the time" and "doesn't create too many additional problems".
Like how the rich logging handler works? Or something different? You can definitely write custom handlers for python loggers. Pytorch is a bit more of a pain though.