We all know the difference between \global\def and \def inside a group. I'd like to know if there is a middle ground (like the nonlocal keyword in Python) where the \def is scoped to the parent group.
For example:
\begingroup
\begingroup
\def\a{a}
\global\def\b{b}
% wishlist modifier
\nonlocal\def\c{c}
\endgroup
\a % breaks
\b % should be fine
\c % should be fine
\endgroup
\a % breaks
\b % should be fine
\c % breaks
The simple solution is to define \c before the second group, but this isn't always possible. What if \c depends on \a and \b?