This improves handling of wrapped functions and bound methods.
It turns out that we no longer need to hack in support for
functools.partial; inspect.signature handles this automatically. Added
a test to make sure this didn't/doesn't regress.
The fallback implemented in #2731 cannot return `obj.__dict__[name]`
if the `__dict__` method has been redefined in such a way that it
raises an exception when trying to access it.
This commit adds a try-except block to work around this.