I just pulled latest master at https://github.com/bitcoin/bitcoin/commit/3ace3a17c9bce606cea05192f0da3ac62ac69dda and I cannot run bitcoind or bitcoin-cli without providing a full path for data directory using `-datadir` option. It was working fine couple of days ago (while running https://github.com/bitcoin/bitcoin/commit/807169e10b4a18324356ed6ee4d69587b96a7c70). I suspect it may be related to latest switch to the standard std::filesystem library https://github.com/bitcoin/bitcoin/pull/20744

**Expected behavior**

I use a symbolic link to point my /home/me/.bitcoin to an external hard drive. When running `bitcoind` from command line, or executing `bitcoin-cli` commands, without using the `-datadir` option, it should not terminate or crash unexpectedly. Those commands should be able to follow the symbolic link and be able to read/write into the final folder.

**Actual behavior**

`bitcoind` and `bitcoin-cli` are not able to follow the symbolic link. `bitcoin-qt` runs fine, even when running it from command line. See below commands examples.

```
# Create a symbolic link
$~/btc-things/bitcoin$ ln -s /media/DATA/Bitcoin /home/me/.bitcoin

# Try to run bitcoind - Crashes
$~/btc-things/bitcoin$ ./bitcoind 


************************
EXCEPTION: NSt10filesystem7__cxx1116filesystem_errorE       
filesystem error: cannot create directories: Not a directory [/home/me/.bitcoin]       
bitcoin in AppInit()       

bitcoind: chainparamsbase.cpp:35: const CBaseChainParams& BaseParams(): Assertion `globalChainBaseParams' failed.
Aborted (core dumped)

# Run bitcoin-qt, it works fine, the node runs
$~/btc-things/bitcoin$ ./bitcoin-qt 
qt5ct: using qt5ct plugin

# Try to run a bitcoin-cli command to interact with the running node, does not work
$~/btc-things/bitcoin$ ./bitcoin-cli getblockhash 501726


************************
EXCEPTION: NSt10filesystem7__cxx1116filesystem_errorE       
filesystem error: cannot create directories: Not a directory [/home/me/.bitcoin]       
bitcoin in AppInitRPC()       

# Try the same previous command but give an absolute path for -datadir, works fine
$~/btc-things/bitcoin$ ./bitcoin-cli -datadir=/media/DATA/Bitcoin getblockhash 501726
0000000000000000004b27f9ee7ba33d6f048f684aaeb0eea4befd80f1701126
```

**To reproduce**

Steps are indicated previously.

**System information**

<!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->

Running `Bitcoin Core version v22.99.0-3ace3a17c9bc`. Self compiled from `master` branch.

<!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->

I'm using Linux Mint with the following kernel `Linux 5.4.0-96-generic x86_64`.
I'm using an additional hard drive to store the full blockchain (SSD).

<!-- Any extra information that might be useful in the debugging process. -->

I had no prior issues before pulling latest changes. I was previously running at https://github.com/bitcoin/bitcoin/commit/807169e10b4a18324356ed6ee4d69587b96a7c70
{
    return m_network == CBaseChainParams::MAIN || m_network_only_args.count(arg) == 0;
}
util::SettingsValue ArgsManager::GetSetting(const std::string& arg) const
{
    LOCK(cs_args);
    return util::GetSetting(
        m_settings, m_network, SettingName(arg), !UseDefaultSection(arg),  false);
}
std::vector<util::SettingsValue> ArgsManager::GetSettingsList(const std::string& arg) const
{
    LOCK(cs_args);
    return util::GetSettingsList(m_settings, m_network, SettingName(arg), !UseDefaultSection(arg));
}
void ArgsManager::logArgsPrefix(