Revert "[optim] Make casting to match params a hook (#106725)"
This reverts commit 9f86d8517201a3d473a8e80d12e22b46570c88a2.
Reverted https://github.com/pytorch/pytorch/pull/106725 on behalf of https://github.com/janeyx99 due to We acknowledge this is a huge risk because people do not remember to call super().__init__ from their Optimizer subclasses and so this will break lots of load_state_dict behavior ([comment](https://github.com/pytorch/pytorch/pull/106725#issuecomment-1693386137))