Well, printf flushes when \n is encountered. Does zig have something similar?
And data files don't generally end with a newline.
POSIX buffers aren't generally flushed until fflush or fclose is called (or when the buffer is full). fclose is automatically called on exit(), which is why explicit flushing isn't usually needed. Note that this requires stdio to maintain a global list of open files, which is something that the Zig stdlib doesn't do for numerous good reasons.
If stdout is connected to a terminal, it is already line buffered and one doesn’t need to setvbuf at all