pdb: modernize find_function() and add tests for it.

Closes #18714.
3 files changed