gh-92898: Enhance _testcppext test on cast to PyObject* (GH-93111)


* Add StrongRef class.
* Rename and reformat functions of the _Py_CAST() implementation.
(cherry picked from commit 20d30ba2ccf9182e4f08db112f428c909148a40b)

Co-authored-by: Victor Stinner <vstinner@python.org>
3 files changed