I think the operators panic. In zig, If you want safe operations I think there are functions in the stdlib
The branching does not cost as much as you think, I'm pretty sure the compiler marks the erroring path as cold, which the cpu can use to elide most of the branch cost through specex