bpo-39573: Add Py_SET_TYPE() function (GH-18394)

Add Py_SET_TYPE() function to set the type of an object.
diff --git a/Modules/_sha3/sha3module.c b/Modules/_sha3/sha3module.c
index d4ca9a1..9cdee58 100644
--- a/Modules/_sha3/sha3module.c
+++ b/Modules/_sha3/sha3module.c
@@ -713,7 +713,7 @@
 
 #define init_sha3type(name, type)     \
     do {                              \
-        Py_TYPE(type) = &PyType_Type; \
+        Py_SET_TYPE(type, &PyType_Type); \
         if (PyType_Ready(type) < 0) { \
             goto error;               \
         }                             \