Fixes #10746. If no -conf flag is passed and no bitcoin.conf file exists in the datadir, then a bitcoin.conf template will be created in the datadir. This conf file will have no configurations set, only explanatory comments. The default bitcoin.conf template was copied from contrib/debian/examples/bitcoin.conf.
The lack of a default config file historically causes a lot of confusion for new users because bitcoind will print Using config file
$DATADIR/bitcoin.conf
on startup even if no file exists.
Curious if error handling is being done properly here or if file permissions need to be considered. I don’t think a failure to create this file should terminate the process.