I see this happen a lot with python projects. In my opinion, a superior strategy is to simply import python config modules, e.g. config.py.
You can always write a dictionary into that config file, just like you would with normal yaml. It would actually be sort of nice if python had support for yaml style dictionaries exactly for this purpose.
That's why erlang has file:consult from the start. It just reads whatever data is in file, that data can be any valid erlang terms. That format is also used for typical system configuration files. Of course, you could make execution based on that configuration file, it happens that erlang already has "standardised" way of storing this as {M,F,A} (module, function, args), which you could send directly to apply:
Same here is JS land. We have JSON (and JSONC) but it's easier to just have a `js` config file, with comments, importing the `dotenv` module for secrets values, or whatever else you need.
You can always write a dictionary into that config file, just like you would with normal yaml. It would actually be sort of nice if python had support for yaml style dictionaries exactly for this purpose.