Fix type hints for None constants (#23029)
Summary:
The type hint was being ignored when emitting `None` constants, this also de-dups some testing code
](https://our.intern.facebook.com/intern/diff/16364572/)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/23029
Pulled By: driazati
Differential Revision: D16364572
fbshipit-source-id: 64f3abd3e37ee49c209480a85ed4f1b8802e5d93