- 🇬🇧United Kingdom catch
If you run file_exists() against a non-existing file, there is no caching from PHP at all - the filesystem will check whether the file exists on every single request to Drupal, because it can never guarantee that it's not just been written. See the docs on https://www.php.net/manual/en/function.clearstatcache.php
How bad this is probably depends on the individual file system, but since settings.php is loaded for the internal page cache, even a small change can have a measurable impact on those pages.
Also since this issue was created, sites are built with composer which includes scaffolding for settings.php, so it's a lot easier to manage stuff like this in git.
Marking this works as designed.