> Ok, I guess the string manipulations in Python are implemented with C as well,
Yes, most basic operations in Python are generally coded in C and are optimized well. But what you can try: Put all your code in a main() proc. Whenever you do benchmarking, you should do that, in some cases it can increase performance drastically.
