There's a few things you can do.
1) just build in release mode (not a good solution, since you can't debug too well this way)
2) add another build configuration based on "Release" but with debug symbols and without the _DEBUG
preprocessor definition (can mess up some libraries)
3) find or build a Python 2.7 version with debug and release libraries build in Visual Studio 2010
4) just change this one section in the pyconfig.h
where it actually links to the *.lib file to just use the python27.lib
for both configurations.
/* For an MSVC DLL, we can nominate the .lib files used by extensions */
#ifdef MS_COREDLL
# ifndef Py_BUILD_CORE /* not building the core - must be an ext */
# if defined(_MSC_VER)
/* So MSVC users need not specify the .lib file in
their Makefile (other compilers are generally
taken care of by distutils.) */
# ifdef _DEBUG
# //-----------------------change the next line-------------//
# pragma comment(lib,"python27_d.lib")
# else
# pragma comment(lib,"python27.lib")
# endif /* _DEBUG */
# endif /* _MSC_VER */
# endif /* Py_BUILD_CORE */
#endif /* MS_COREDLL */
1) 2) and 4) are hacky solutions, so I'd suggest you try to use 3).