[WIP] Allow dynamic legacy flag.

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | na
| License       | MIT
| Doc PR        | na

This is an idea to provide granularity of what legacy mode means (as controlled by the compat_layer) flag.