I hesitated for a long time to ask such an elementary-seeming question on Math Overflow, but when I asked and bountied it on Math SE, I found that a few experts seem to disagree on the answer, and I didn't get enough responses to indicate a statistically significant consensus.

A cursory online search gives that about half the sources include the requirement of orientability in the Gauss-Bonnet theorem, and half don't. (I listed eight on the "no" side in the SE question; a Google search yields many more on the "yes" side.)

Ted Shifrin claims that

It is absolutely a necessity, as to define the [global] integral $\iint_M K dA$ requires an orientation.... (The far abstracted version of Gauss-Bonnet refers to the Euler class of the tangent bundle of an oriented 2n-dimensional Riemannian manifold. Orientability is needed there, too, to define the Pfaffian of the curvature matrix.)

Sunghyuk Park, on the other hand, gives an answer claiming that with any non-orientable surface you can consider its orientable double cover, and for that double cover all three terms (the Gaussian curvature surface integral, the boundary geodesic curvature line integral, and the Euler characteristic term) all double, so that the theorem remains true. Ted Shifrin concedes that the theorem might hold for closed non-orientable surfaces, but claims that the boundary line integrals actually cancel out instead of doubling.

So what's the deal? Does the Gauss-Bonnet theorem hold for (a) any compact non-orientable surface, (b) only closed non-orientable surfaces, or (c) no (nontrivial) generic class of non-orientable compact surfaces?

closednon-orientable surfaces $S$, viewing $\iint K\,dA$ as the integral of the Gaussian curvature $K$ with respect to the area measure (speaking about measures completely avoids orientability). Proof: if you pass to the oriented double cover $\widehat S$, both sides $\iint K\,dA$ and $2\pi\chi(S)$ double their value; since they are equal for $\widehat S$, they coincide also for $S$. $\endgroup$1more comment