Add an "optimize" parameter to compile() to control the optimization level, and provide an interface to it in py_compile, compileall and PyZipFile.
diff --git a/Include/compile.h b/Include/compile.h
index 4a5ebe6..456a494 100644
--- a/Include/compile.h
+++ b/Include/compile.h
@@ -29,8 +29,9 @@
 #define FUTURE_BARRY_AS_BDFL "barry_as_FLUFL"
 
 struct _mod; /* Declare the existence of this type */
-PyAPI_FUNC(PyCodeObject *) PyAST_Compile(struct _mod *, const char *,
-					PyCompilerFlags *, PyArena *);
+#define PyAST_Compile(mod, s, f, ar) PyAST_CompileEx(mod, s, f, -1, ar)
+PyAPI_FUNC(PyCodeObject *) PyAST_CompileEx(struct _mod *, const char *,
+					   PyCompilerFlags *, int, PyArena *);
 PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromAST(struct _mod *, const char *);
 
 
diff --git a/Include/pythonrun.h b/Include/pythonrun.h
index 95bdf9e..4eae549 100644
--- a/Include/pythonrun.h
+++ b/Include/pythonrun.h
@@ -76,9 +76,10 @@
 #ifdef Py_LIMITED_API
 PyAPI_FUNC(PyObject *) Py_CompileStringFlags(const char *, const char *, int);
 #else
-#define Py_CompileString(str, p, s) Py_CompileStringFlags(str, p, s, NULL)
-PyAPI_FUNC(PyObject *) Py_CompileStringFlags(const char *, const char *, int,
-                                             PyCompilerFlags *);
+#define Py_CompileString(str, p, s) Py_CompileStringExFlags(str, p, s, NULL, -1)
+#define Py_CompileStringFlags(str, p, s, f) Py_CompileStringExFlags(str, p, s, f, -1)
+PyAPI_FUNC(PyObject *) Py_CompileStringExFlags(const char *, const char *, int,
+                                               PyCompilerFlags *, int);
 #endif
 PyAPI_FUNC(struct symtable *) Py_SymtableString(const char *, const char *, int);