[ty] Prepare mdtests for return type inference (#29295)
## Summary
This PR prepares our mdtests for return type inference. For example, we
had some definitions like
```py
def flag(): ...
```
which were supposed to be used in `if flag()` tests of ambiguous
truthiness. However, with return type inference, ty would understand
that this function returns `None`, which is falsy.
I'm pulling this out so as to reduce the diff on the upcoming return
type inference PR.
## Test Plan
Tested by running the return type inference implementation against these
changes.