Optimize ascii(str): don't encode/decode repr if repr is already ASCII
diff --git a/Objects/object.c b/Objects/object.c
index fd1fd25..79f1c8a 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -451,6 +451,9 @@
     if (repr == NULL)
         return NULL;
 
+    if (PyUnicode_IS_ASCII(repr))
+        return repr;
+
     /* repr is guaranteed to be a PyUnicode object by PyObject_Repr */
     ascii = _PyUnicode_AsASCIIString(repr, "backslashreplace");
     Py_DECREF(repr);