We prove that Chevalley groups over polynomial rings $\mathbb F_q[t]$ and over Laurent polynomial $\mathbb F_q[t,t^{-1}]$ rings, where $\mathbb F_q$ is a finite field, are boundedly elementarily generated. Using this we produce explicit bounds of the commutator width of these groups. Under some additional assumptions, we prove similar results for other classes of Chevalley groups over Dedekind rings of arithmetic rings in positive characteristic. As a corollary, we produce explicit estimates for the commutator width of affine Kac--Moody groups defined over finite fields. The paper contains also a broader discussion of the bounded generation problem for groups of Lie type, some applications and a list of unsolved problems in the field.