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