bpo-28029: Make "".replace("", s, n) returning s for any n != 0. (GH-16981)

diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 2d60627..5ae0af8 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -10572,9 +10572,12 @@
     int mayshrink;
     Py_UCS4 maxchar, maxchar_str1, maxchar_str2;
 
+    if (slen < len1)
+        goto nothing;
+
     if (maxcount < 0)
         maxcount = PY_SSIZE_T_MAX;
-    else if (maxcount == 0 || slen == 0)
+    else if (maxcount == 0)
         goto nothing;
 
     if (str1 == str2)