Is your feature request related to a problem or challenge? Please describe what you are trying to do.
When writing optimizer rules, it is sometime necessary to generate things like aliases which must have unique names. Currently, there is no mutable context in which this can be done, so the only possibility is to use something like a UUID, which is both not easy to read and not deterministic for testing.
Describe the solution you'd like
For the reasons described above, it would be nice to make the OptimizerConfig mutable, so we can add a next_id() function to generate unique identifiers.
Describe alternatives you've considered
One could argue that this is an abuse of something called "config", and break out a separate context (which could possible wrap the existing immutable config).
Additional context
See PR #2885