Thanks for writing this up! It's a great step forward.
A few quick comments:
- It's a very ambitious proposal, which increases the risk that it gets bogged down due to some small aspect. Concretely, perhaps default values for TypeVars should be saved for another PEP; I know there's already a draft PEP for that feature floating around.
- The idea of adding a new lexical scope is clever but may lead to a rabbit hole of runtime subtleties, especially for classes nested in functions. An alternative approach could use an implicit `del` for names defined as TypeVars, similar to the way except blocks work.
- "A duplicate name generates a syntax error at runtime" -> should be "compile time"