I guess my comment is worth expanding into an answer. Over an arbitrary field $k$, an invariant polynomial on $\mathcal{M}_n(k)$ extends to an invariant polynomial on $\mathcal{M}_n(\bar{k})$. Since the diagonalizable matrices are Zariski dense in $\mathcal{M}_n(\bar{k})$, such a polynomial is determined by what it does to diagonal matrices, and it must be a symmetric polynomial of the entries of any diagonal matrix. Conversely, over an arbitrary field (in fact over an arbitrary commutative ring $R$) the elementary symmetric polynomials (all of which are coefficients of the characteristic polynomial, hence all of which really do come from invariant polynomials) generate the ring of symmetric polynomials in $n$ variables.

Hence the invariants of degree $d$ are precisely the symmetric polynomials of degree $d$ over $k$. A basis of the symmetric polynomials of degree $2$ is always given by $\{ e_1^2, e_2 \}$ where $e_i$ is the $i^{th}$ elementary symmetric polynomial. When $\text{char}(k) \neq 2$ we can instead use $\{ p_1^2, p_2 \}$ where $p_i$ is the $i^{th}$ power sum, since $p_1 = e_1$ and $p_2 = \frac{e_1^2 - e_2}{2}$, but if $\text{char}(k) = 2$ this change of coordinates is not well-defined.

Wikipedia should have proofs of the statements I made above about symmetric polynomials; alternately, see for example Chapter 7 of Stanley's *Enumerative Combinatorics Vol. II*. Note that on the one hand this result constrains what the possible characters of a "nice" representation of $\text{GL}_n$ can look like, and on the other hand suggests that the characters of the "nice" irreducible representations of $\text{GL}_n$ form a distinguished basis for the symmetric polynomials. These are precisely the Schur polynomials.