I translate into English Lemma 6.5 from Sansuc's paper Groupe de Brauer et arithmétique des groupes
algébriques linéaires sur un corps de nombres, J. reine angew. Math.
327 (1981), 12-80.
Let $X$ be an algebraic variety over an arbitrary field $k$,
i.e a geometrically integral algebraic $k$-scheme.
We denote $ U(X) := k[X]^* / k^* $,
the group of units of the ring of regular functions $k[X]^*$
modulo nonzero constants.
Rosenlicht's theorem: Let $X$ and $Y$ be two algebraic $k$-varieties
and $G$ be a connected, smooth, linear algebraic $k$-group, .
(i) $U(X)$ is a finitely generated free abelian group;
(ii) $U(X\times_k Y)=U(X)\oplus U(Y)$;
(iii) $U(G)=\hat{G}(k)$ (the group of $k$-characters of $G$).
Reference: M. Rosenlicht, Toroidal algebraic groups,
Proc. AMS 12 (1961), 984–988,
scan here.
For other references see Sansuc's paper.
(i) answers the question.
Rosenlicht's proof of (i) is close to Mohan's answer.