Hi Florian,
On the contrary, I would argue that it is common practice for programs to create a default config file if one does not exist. Linphone does it (at least on Linux, and I think it's similar on all platforms).
So if it was me, I would simply check if the config file exists, and if it doesn't, create the file before your code that is failing. You can either create a separate method for default settings, or just provide default values when you're reading them in. Even though it's a little more work up-front, I always prefer the former. It just seems much easier to maintain, and also your reading is separated from your writing, so you could provide other defaults via your program code (based on options in use).
A lot more than you asked, but I hope this answers at least how I feel about the question. 😎