Revert the fix for #1548891, it broke backwards compatibility with arbitrary read buffers.
Fixes #1730114.
diff --git a/Modules/cStringIO.c b/Modules/cStringIO.c
index 5834e20..0cc9c6b 100644
--- a/Modules/cStringIO.c
+++ b/Modules/cStringIO.c
@@ -673,8 +673,11 @@
   char *buf;
   Py_ssize_t size;
 
-  if (PyObject_AsCharBuffer(s, (const char **)&buf, &size) != 0)
-      return NULL;
+  if (PyObject_AsReadBuffer(s, (const char **)&buf, &size)) {
+    PyErr_Format(PyExc_TypeError, "expected read buffer, %.200s found",
+                 s->ob_type->tp_name);
+    return NULL;
+  }
 
   self = PyObject_New(Iobject, &Itype);
   if (!self) return NULL;