Let $q$ be a power of an odd prime number $p>3,$ say $q=p^r$ with $r \geq 1.$ It is known that every polynomial $M$ in $GF(q)[t]$ is a sum of at most $3$ squares with some conditions on degrees. More precisely:

a) $$ M = A^2+B^2+C^2 $$

for some polynomials $A, B, C \in GF(q)[t]$ such that

b) $$ \deg(A^2) < \deg(M)+2, \deg(B^2) < \deg(M)+2, \deg(C^2) < \deg(M)+2. $$

Question: For a given such $M$ that is square-free, how many such $3$-tuples $(A,B,C)$ there are ???

The known proof is *indirect* so unfortunately cannot be worked out to display
(or count) the solutions.

The proof is in:

MR1143282 (92k:11103) Effinger, Gove W.; Hayes, David R. Additive number theory of polynomials over a finite field. Oxford Mathematical Monographs. Oxford Science Publications. The Clarendon Press, Oxford University Press, New York, 1991. xvi+157 pp. ISBN: 0-19-853583-X (Reviewer: David Goss), 11P05 (11P32 11P55 11T55)

Section 2, Sums of Squares, pages 7 to 11.