$A^\times/k^\times$ is a free $\mathbb{Z}$-module of rank of at most $r - 1$ Consider an algebraically closed field $k$, a finite extension $K$ of $k(T)$, the integral closure $A$ of $k[T]$ in $K$, the integral closure $A'$ of $k[1/T]$ in $K$, and the integral closure $A''$ of $k[T, 1/T]$ in $K$. Let$$S =  \max(A') - \max(A'') = X - \max(A),$$where $X$ is the union of $\max(A) \cup \max(A')$, and let $r$ be the number of elements of $S$. How do I see that $A^\times/k^\times$ is a free $\mathbb{Z}$-module of rank of at most $r - 1$?
 A: If I understand your question correctly, it seems to me that $X$ is the unique smooth projective curve with function field $K$. Your question then boils down to the following.

Lemma. Let $X$ be a smooth projective curve, and let $x_1, \ldots, x_r \in X$ be distinct points. Set $U = X \setminus \{x_1, \ldots, x_r\}$. Then $\Gamma(U, \mathcal{O}_U)^\times/k^\times$ is a free $\mathbb{Z}$-module of rank at most $r - 1$.

Proof. We have the short exact sequence$$0 \to \mathcal{O}_X^\times \to \mathscr{K}^\times \to \mathcal{O}_X^\times/\mathscr{K}^\times \to 0$$of sheaves on $X$, where $\mathscr{K}$ is the constant sheaf with value $K$, see Proposition II.6.11 of Hartshorne. Comparing the long exact cohomology sequences on $X$ and $U$ gives commutative diagrams$$\require{AMScd}
\begin{CD}
0 @>>> k^\times @>>> K^\times @>>> \text{Prin}(X) @>>> 0\\
@.     @VVV     @VVV     @VVV     @. \\
0 @>>> \Gamma(U, \mathcal{O}_U)^\times @>>> K^\times @>>> \text{Prin}(U) @>>> 0
\end{CD}\tag*{$(1)$}
$$
and$$\require{AMScd}
\begin{CD}
0 @>>> \text{Prin}(X) @>>> \text{Div}(X) @>>> \text{Pic}(X) @>>> 0\\
@.     @VVV     @VVV     @VVV     @. \\
0 @>>> \text{Prin}(U) @>>> \text{Div}(U) @>>> \text{Pic}(U) @>>> 0
\end{CD}\tag*{$(2)$}
$$with exact rows. In $(2)$, all vertical maps are surjective. Write $A$, $B$, $C$ for the vertical kernels respectively. We know that $B = \bigoplus \mathbb{Z}x_i$ is free of rank $r$. The image of $A \to B$ lands inside the hyperplane of degree $0$ elements; thus $A$ is free of rank at most $r - 1$.
In $(1)$, the second vertical map is an isomorphism. The result now follows from the snake lemma.$$\tag*{$\square$}$$Remark 1. In general, we do not get exact rank $r - 1$. For example, if $(E, O)$ is an elliptic curve, and $P \in E$ is a nontorsion point, then there is no rational function whose divisor is $mP + nO$. Thus, $H^0(E \setminus \{O, P\}, \mathcal{O}) = k$.
This also shows for example that $E \setminus \{O, P\}$ is not affine, which means it does not arise as an example of your construction. We have to be a little bit more clever to make a counterexample that actually arises in your way.
Remark 2. Note the similarity with Dirichlet's $S$-unit theorem in number theory. This is no coincidence: the $S$-unit theorem and the finiteness of the $S$-class group are essentially equivalent to the compactness of the $S$-idèle class group, which is in some sense the number theoretic analogue of the Jacobian of $C$.
