Fixes #4851: a SmartProxy.with_features scope replaces feature-specific scopes generated during class loading
Fixes #4851: a SmartProxy.with_features scope replaces feature-specific scopes generated during class loading