backport std::bit_cast from c++20 to c10 (#98417)
This is already used in a few places in our codebase, so let's
standardize on a tested implementation.
Differential Revision: [D44712290](https://our.internmc.facebook.com/intern/diff/D44712290/)
**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D44712290/)!
Pull Request resolved: https://github.com/pytorch/pytorch/pull/98417
Approved by: https://github.com/ezyang