If the compact connected group $K$ is second-countable (hence metrizable, hence Polish), one can prove it with pretty much straight measure theory.  (I am not sure if this argument remains valid for non-metrizable groups.)

It's based on the following elementary lemma which is due (in some form) to Steinhaus:

> **Lemma.** Let $G$ be a locally compact Polish group with a left-invariant Haar measure $\mu$, and $A \subset G$ be a Borel set with $\mu(A) > 0$.  Then the set $A^{-1} A$ contains an open neighborhood of the identity.  In particular, if $A$ is a subgroup of $G$ then $A$ is open.

You can find it as Exercise 17.13 (ii) in Kechris, *Classical Descriptive Set Theory*.  You begin by showing that the function $x \mapsto \mu(xA \triangle A)$ is continuous, which uses the regularity of the measure or else Lusin's theorem.  (The proof I know uses dominated convergence and hence only shows that this function is *sequentially* continuous, which is why I am unsure about the non-metrizable case.)

So suppose that there is a positive probability $p > 0$ of two elements commuting.  Let $C_x$ denote the centralizer of $x \in K$, which is a closed subgroup of $K$.  By Fubini's theorem, we have $p = \int_K \mu(C_x) \mu(dx)$.  So if $p>0$, the set $A = \{x : \mu(C_x) > 0\}$ must have positive measure: $\mu(A) > 0$.

But if $x \in A$, so that $\mu(C_x) > 0$, then by our lemma, $C_x$ is an open subgroup of $K$.  It was already closed, and $K$ is connected, so $C_x = K$, i.e. $x$ is in the center $Z$ of $K$.

We have thus shown $\mu(Z) > 0$.  Noting that $Z$ is a closed subgroup and applying our lemma again, $Z$ is open and so $Z=K$, i.e. $K$ is abelian.

I think there should also be a "Baire category" analogue of this statement: if $\{ (x,y) : xy = yx\}$ is nonmeager in $K \times K$ then $K$ is abelian.  This would use the Pettis lemma in place of the unnamed lemma above, and there is "Fubini theorem" for Baire category which I've seen but can't recall the name or the reference.