Enforce const on PyRRef functions (#38415)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/38415
Test Plan: Imported from OSS
Reviewed By: rohan-varma
Differential Revision: D21554722
Pulled By: mrshenli
fbshipit-source-id: 53c2abd8de43545873be486e1fb893bc329d65a1