There are more elementary variants, but this one is the shortest:
Since taking the third power fixes $0$, the sign of $\pi$ is determined by the sign of its action on the nonzero residues modulo $p$. As $\mathbb{F}_{p}^{\times}$ is a cyclic group of order $p − 1$, $\pi$ is the same as multiplication by $3$ on $\mathbb{Z}/(p − 1)$. This permutation is the same as the action of Frobenius element at $3$ acting on $\mu_3 = \left\{w_1, · · · , w_{p−1}\right\}$, the set roots of $f(x) = x^{p-1}-1$. Its action on the roots of this polynomial is even iff it acts trivially on the square root of the discriminant of this polynomial, which is
$$d:= \prod_{i < j} (w_i - w_j)$$
This, in turn, is true iff $3$ splits in the extension $\mathbb{Q}(d)$. It's not hard to see that
$$(-1)^{\binom{p-1}{2}}d^2 = \prod_{i,j=1}^{p-1}(w_i-w_j) = \prod_{i=1}^{p-1}f'(w_i) = -(p-1)^{p-1},$$
which is a square times $−1$.Therefore, if $p \equiv 3 \mod {4}$, then $\binom{p-1}{2}$ is odd, so adjoining the square root of the discriminant gives $\mathbb{Q}$, so $3$ splits tautologically, and the permutation is even. If $p \equiv 1 \mod{4}$, then the extension is $\mathbb{Q}(i)$, in which $3$ does not split, so the permutation is odd.