Currently ArgsManager::GetDataDir() ensures it will always return a datadir by creating one if necessary. The function is shared between bitcoind bitcoin-qt and bitcoin-cli which results in the undesirable behaviour described in core#20070.
This PR splits out the part of the function which creates directories and adds it as a standalone function, only called as part of bitcoind and bitcoin-qt init, but not bitcoin-cli.
This changes behaviour of GetConfigFilePath which now always returns the
absolute path of the provided -conf argument.
This is a backport of core#27073
Depends on D16192