The alternate form pattern %#x will not add the 0x prefix when the value is 0, leading to inconsistent output. This behavior is not documented in the linux-manpages page for printf, however both glibc and musl agree on it.
At least the version of printf(3) installed on my system states that the 0x prefix is only added to non-zero values. Still, I agree that its better to have the output be consistent.
The alternate form pattern %#x will not add the 0x prefix when the value is 0, leading to inconsistent output. This behavior is not documented in the linux-manpages page for printf, however both glibc and musl agree on it.