Quoting T347135: Allow full unredacted stack trace for development
It seems this was initially controlled by a variable for select list of functions (that actually needed this masking, e.g. password strings) before being extended to everything in change 92334. The link given as the reason for the latter change is https://lists.wikimedia.org/hyperkitty/list/wikitech-l@lists.wikimedia.org/thread/FOSXLMTUZBDDP6FPVDFBJYJFQTAVOPKE/. Whatever was that however, does not even matter, for local development it should be configurable.
Additionally, in general, with the the introduction of SensitiveParameter attribute at PHP 8.2, I think this custom redaction logic should just be discarded completely in favor of the selective redaction through the PHP attribute.
Now T358666: Drop PHP 8.1 support from MediaWiki is in progress (effectively we've dropped PHP 8.1 support in favour of PHP 8.2), we should look at moving forward on doing something with this...