The panic function is not called automatically, it is explicitely called by devs as a last resort when all is lost.
Actually, We just hope that printf is still available to "export" the error message, before halting the system (in development mode, where debuggers will hopefully give you access to the 'panic_str' global variable anyway) or making an hard reboot.