fix access to attributes of optimised builtin methods (e.g. '__name__')