So what is the reason for all the rest of the indirection and macros? Why __printf and then aliased to printf? Why is outchar a macro instead of being factored into a function? If you asked me to implement printf I wouldn't immediately do all of this - so what would my implementation be missing that makes these necessary?
I can speculate: __printf(), having two leading underscores, is a named reserved for "the implementation," meaning the compiler and standard library. This enables at least one useful thing, which is that the standard library (or a third-party library I guess) can use this function when it needs to print things, and not worry that printf() has been redefined by the application.
You might think, but who in their right mind would redefine printf()? But C has an infinite number of people using it all the time, so every possible weird thing has been done a few times by now.
> You might think, but who in their right mind would redefine printf()?
One cannot discount those in their wrong mind either.
I had a header dedicated to #undef ing things ruby.h redirected so I could include it in C++ contexts without breaking the SC++L. While I don't see printf on the list, read, write, close, fclose, sleep, and many more are.