I can't imagine that has any significant impact on memory usage, at least for normal multi-GB-RAM servers: the docstrings will only be loaded once.
That's nothing. Armin Ronacher was complaining somewhere about the performance hit from static typing in python and i never though about that before. It'd be best if all of that was removed in prod build along with unused imports, kind of what TypeScript does.
imports can't be safely automatically stripped in Python (or even 100% safely re-ordered) since they could have side effects.
We run a linter that confirms with the user before stripping them, which works out well in practice.
Its apparently true for RPython too, where side effects which cause "methods and other class attributes do not change after startup".
There used to be a performance hit because the annotation objects where all instantiated and attached to the function objects. This is no longer the case - they are only instantiated when inspected.
like PEP484 type annotations having a runtime performance hit? I would be very interested in seeing a link to this if you can dig it up.