Panic when printing after Raylib's InitWindow()

The fact that the early print statement prevents a crash strongly suggests that you’re hitting the same bug as the one from the thread you linked.

https://codeberg.org/ziglang/zig/issues/35512

To work around the bug without actually printing anything to the console, you can add these two statements to the very top of your main function:

 const rl = @cImport(@cInclude("raylib.h"));
 const print = @import("std").debug.print;
 
 pub fn main() void {
-    print("Before InitWindow()\n", .{});
+    std.debug.lockStderr(&.{});
+    std.debug.unlockStderr();
     rl.InitWindow(300, 200, "Test");
     print("After InitWindow()\n", .{});
     rl.CloseWindow();
 }