[3.11] gh-96127: Fix `inspect.signature` call on mocks (#96335) (#101646)

(cherry picked from commit 9e7d7266ecdcccc02385fe4ccb094f3444102e26)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
3 files changed