The goal is to avoid local peers (e.g. untrusted peers on the local network or inbound onion peers via a local onion proxy) filling the debug log (and thus the disk).
This is a backport of [[https://github.com/bitcoin/bitcoin/pull/20845 | core#20845]]