We use serpent in coder/coder - which has a concept of "experiments". We want to be able to hide config flags when an experiment is hidden.
We obviously shouldn't leak that implementation detail into serpent, but perhaps a configurable func which conditionally hides a flag based on the return value could work.