Frankly, I would find it much easier to write the naive C version than this "moderately" optimized Python version in the article although I am much more familiar with Python than with C.
Also I really dislike python optimization tricks like `output = stdout.buffer.write`.
Grab a web page and parse it for some data. Suddenly, C looks like trash. The network latency negates any speed advantage from C and the fact that C has to manually manage memory everywhere makes your C code look like a dumpster fire relative to the Python code. You can always pick a task that favors one language or the other.
What people forget is that fast/slow ALSO includes "time to develop the code". If I can write the Python code in 1 hour and the C code in 10 hours, the code has to be a lot slower or be run a lot more times before the time wasted writing the C code pays off.