I recently asked about calculating the Euler characteristic of the symmetric square of a space. There we determined that for a sufficiently well-behaved space $X$ there is a formula $\chi(X \times X) = \chi(\text{Diag}(X)) + 2 (\chi(X^{(2)}) - \chi(X))$ where $\chi$ is the Euler characteristic, $X^{(2)}$ is the symmetric square of $X$, and $\operatorname{Diag}(X)$ is the the diagonal embedding of $X$ in $X\times X$.
I believe a slight generalisation of the statement should also be true, namely $\chi(\mathscr{O}_{X\times X}) = \chi(\mathscr{O}_{\operatorname{Diag}(X)}) + 2(\chi(\mathscr{O}_{X^{(2)}}) - \chi(\mathscr{O}_X))$ where $X$ is an algebraic variety, $\mathscr{O}_V$ denotes the structure sheaf of $V$, and $\chi$ is the Euler characteristic of the sheaf cohomology (recall that this means, for an $\mathscr{O}_X$-module $\mathscr{F}$, $\chi(\mathscr{F}) = \sum_i (-1)^i \dim H^i(X, \mathscr{F})$).
Question: Does anyone know a reference for this result or a short proof? Does it follow easily from the first formula above or do we need more sophisticated sheaf-cohomological machinery?
Note that for the application that I have in mind I need the result for algebraic varieties (even just smooth algebraic curves) over an algebraically closed field (whose characteristic may be positive), but a more general result would be nice to see.