Bitcoin Core has a single gArgs, which is used by all binaries (bitcoind, bitcoin-qt, bench_bitcoin, bitcoin-wallet, …). This is generally fine, because binaries only need to parse arguments for themselves.
However, for testing purposes in bench_bitcoin, some benchmarks (at the time of writing I believe two) spin up a Bitcoin Core node via the TestingSetup NodeContext. Thus, they will end up with conflicting use of gArgs. This issue is fixed in bitcoin #18662
Moreover, test_bitcoin might want to set up and pass around local ArgsManagers without modifying the “main” global gArgs. Also, some args are parsed from gArgs inside the mempool or other validation code, which also makes it hard for unit tests to mock those settings. Slowly getting rid of usages of gArgs is going to help with that.
And finally, globals usually come with other issues such as the static initialization fiasco. Getting rid of them will make the code cleaner. @MarcoFalke started doing that in commit fa6b97c, as an example.
They can be found with git grep -W ‘gArgs.AddArg("’.
This idea is proposed by @MarcoFalke