inspect: Validate that __signature__ is None or an instance of Signature.

Closes #21801.
3 files changed