Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever
possible.  Patch is writen with Coccinelle.
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
index 5069285..e6a2f25 100644
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -188,8 +188,7 @@
 PyCursesCheckERR(int code, const char *fname)
 {
     if (code != ERR) {
-        Py_INCREF(Py_None);
-        return Py_None;
+        Py_RETURN_NONE;
     } else {
         if (fname == NULL) {
             PyErr_SetString(PyCursesError, catchall_ERR);
@@ -414,14 +413,14 @@
     static PyObject * PyCursesWindow_ ## X                              \
     (PyCursesWindowObject *self)                                        \
     {                                                                   \
-        if (X (self->win) == FALSE) { Py_INCREF(Py_False); return Py_False; } \
-        else { Py_INCREF(Py_True); return Py_True; } }
+        if (X (self->win) == FALSE) { Py_RETURN_FALSE; } \
+        else { Py_RETURN_TRUE; } }
 
 #define Window_NoArgNoReturnVoidFunction(X)                     \
     static PyObject * PyCursesWindow_ ## X                      \
     (PyCursesWindowObject *self)                                \
     {                                                           \
-        X(self->win); Py_INCREF(Py_None); return Py_None; }
+        X(self->win); Py_RETURN_NONE; }
 
 #define Window_NoArg2TupleReturnFunction(X, TYPE, ERGSTR)               \
     static PyObject * PyCursesWindow_ ## X                              \
@@ -436,7 +435,7 @@
     {                                                                   \
         TYPE arg1;                                                      \
         if (!PyArg_ParseTuple(args, PARSESTR, &arg1)) return NULL;      \
-        X(self->win,arg1); Py_INCREF(Py_None); return Py_None; }
+        X(self->win,arg1); Py_RETURN_NONE; }
 
 #define Window_OneArgNoReturnFunction(X, TYPE, PARSESTR)                \
     static PyObject * PyCursesWindow_ ## X                              \
@@ -900,8 +899,7 @@
     wborder(self->win,
             ch[0], ch[1], ch[2], ch[3],
             ch[4], ch[5], ch[6], ch[7]);
-    Py_INCREF(Py_None);
-    return Py_None;
+    Py_RETURN_NONE;
 }
 
 static PyObject *
@@ -915,8 +913,7 @@
             return NULL;
     }
     box(self->win,ch1,ch2);
-    Py_INCREF(Py_None);
-    return Py_None;
+    Py_RETURN_NONE;
 }
 
 #if defined(HAVE_NCURSES_H) || defined(MVWDELCH_IS_EXPRESSION)
@@ -1593,11 +1590,9 @@
         return NULL;
     } else
         if (erg == FALSE) {
-            Py_INCREF(Py_False);
-            return Py_False;
+            Py_RETURN_FALSE;
         } else {
-            Py_INCREF(Py_True);
-            return Py_True;
+            Py_RETURN_TRUE;
         }
 }
 
@@ -2158,8 +2153,7 @@
     /* not checking for PyCursesInitialised here since filter() must
        be called before initscr() */
     filter();
-    Py_INCREF(Py_None);
-    return Py_None;
+    Py_RETURN_NONE;
 }
 
 static PyObject *
@@ -2365,11 +2359,9 @@
     if (!PyArg_ParseTuple(args,"i",&ch)) return NULL;
 
     if (has_key(ch) == FALSE) {
-        Py_INCREF(Py_False);
-        return Py_False;
+        Py_RETURN_FALSE;
     }
-    Py_INCREF(Py_True);
-    return Py_True;
+    Py_RETURN_TRUE;
 }
 #endif /* STRICT_SYSV_CURSES */
 
@@ -2566,8 +2558,7 @@
 
     initialised_setupterm = TRUE;
 
-    Py_INCREF(Py_None);
-    return Py_None;
+    Py_RETURN_NONE;
 }
 
 static PyObject *
@@ -2603,11 +2594,9 @@
         return NULL;
     result = is_term_resized(lines, columns);
     if (result == TRUE) {
-        Py_INCREF(Py_True);
-        return Py_True;
+        Py_RETURN_TRUE;
     } else {
-        Py_INCREF(Py_False);
-        return Py_False;
+        Py_RETURN_FALSE;
     }
 }
 #endif /* HAVE_CURSES_IS_TERM_RESIZED */
@@ -2819,14 +2808,12 @@
     switch(PyTuple_Size(args)) {
     case 0:
         qiflush();
-        Py_INCREF(Py_None);
-        return Py_None;
+        Py_RETURN_NONE;
     case 1:
         if (!PyArg_ParseTuple(args, "i;True(1) or False(0)", &flag)) return NULL;
         if (flag) qiflush();
         else noqiflush();
-        Py_INCREF(Py_None);
-        return Py_None;
+        Py_RETURN_NONE;
     default:
         PyErr_SetString(PyExc_TypeError, "qiflush requires 0 or 1 arguments");
         return NULL;
@@ -2954,8 +2941,7 @@
 
     setsyx(y,x);
 
-    Py_INCREF(Py_None);
-    return Py_None;
+    Py_RETURN_NONE;
 }
 
 static PyObject *
@@ -2979,8 +2965,7 @@
             return NULL;
         PyDict_SetItemString(ModDict, "COLOR_PAIRS", cp);
         Py_DECREF(cp);
-        Py_INCREF(Py_None);
-        return Py_None;
+        Py_RETURN_NONE;
     } else {
         PyErr_SetString(PyCursesError, "start_color() returned ERR");
         return NULL;
@@ -3025,8 +3010,7 @@
 
     capname = tigetstr( capname );
     if (capname == 0 || capname == (char*) -1) {
-        Py_INCREF(Py_None);
-        return Py_None;
+        Py_RETURN_NONE;
     }
     return PyBytes_FromString( capname );
 }
@@ -3180,8 +3164,7 @@
         return NULL;
     }
     use_env(flag);
-    Py_INCREF(Py_None);
-    return Py_None;
+    Py_RETURN_NONE;
 }
 
 #ifndef STRICT_SYSV_CURSES
@@ -3195,8 +3178,7 @@
 
     code = use_default_colors();
     if (code != ERR) {
-        Py_INCREF(Py_None);
-        return Py_None;
+        Py_RETURN_NONE;
     } else {
         PyErr_SetString(PyCursesError, "use_default_colors() returned ERR");
         return NULL;