I have a general question about popen (and all related functions), applicable to all operating systems, when I write a python script or some c code and run the resulting exe
Thats correct, and applies to both Windows and Linux (and possibly other systems), with popen() and fopen(). If you want the output buffer to be dispatched before 4096 bytes, use fflush() (on C) or sys.stdout.flush() (Python).