This is more in the abstract-algebra territory rather than complex-analysis (especially not the complex part; the definition of path integral does not really depend on complex structure), but I see two (or three) ways of properly formalizing that.
One way is to follow Willie Wong's suggestion, and take for chains the free monoid with a basis of (sufficiently well-behaved, for instance $C^1$) paths, that is, a $\Gamma$ is a chain if it is a finite sequence of paths, and we add chains by appending one at the end of another; for the remainder of this post, call this monoid $Ch_1$
Another, closely related, is to take it to be instead the free commutative monoid defined by the nice paths -- this is the same as above, except we forget the ordering of the sequence. This is the most literal reading of the statement "formal sum" -- a formal sum of things is, to me anyway, the commutative monoid generated by them. If we call it $Ch_2$ we can see that this is just $Ch_1$ divided by the relation $\Gamma_1\Gamma_2=\Gamma_2\Gamma_1$.
A third, quite a bit more complicated way to interpret it is to take into account what we actually do with the chains: we integrate along them. Furthermore, if we restrict ourselves to nice functions (for instance, globally continuous), we can see that for two very different chains $\Gamma,\Gamma'$ we have $\int_\Gamma$ being the same thing as $\int_{\Gamma'}$ (as linear functionals on the space of continuous functions), for example if $\Gamma'$ is just a subdivision of $\Gamma$.
One way to formalize it is to just equate a chain $\Gamma$ with the integration operator $\int_\Gamma$, effectively seeing the chains just a subgroup $Ch_3$ of the additive group of the dual of the space of continuous functions, $C({\bf R}^n)^*$ (or $C({\bf C}^n)^*$). This means that in particular, we see that the chain consisting of a path $\gamma$ and the path $-\gamma$ obtained by reversing the orientation on $\gamma$ is equated to an empty path – that is because for a continuous function $f$ we have that $\int_\gamma f+\int_{-\gamma} f=0$.
While the reference to the dual of continuous functions may seem rather technical, this is, I believe, the intuitive way to see chains. I think that's where the convention to write $-\gamma$ for an inverted path comes from in the first place.
There is a minor gripe for it: if we integrate functions that are not globally continuous, for example ones that have singularities, such as $z^{-1}$ on ${\bf C}$, we will have pairs of chains that are equivalent, but such that we can integrate along one, but not the other, for example if we take $\gamma$ to be the interval from $-1$ to $1$ on the complex plane, then the equation $\int_\gamma z^{-1}+\int_{-\gamma} z^{-1}=0$ doesn't make sense. This wasn't a problem at all in case of $Ch_1,Ch_2$, since in those ones we never really cancelled any terms.
But it's not that much of a problem in this case, as equivalent chains for which the integral is well defined will integrate a continuous function consistently, even if it is not globally defined.
Best Answer
Here is Artin's proof:
First we need to prove a lemma.
Proof of Lemma:
Suppose $\gamma$ is defined on the interval $[a,b]$. Partition the interval as $a = a_0\leq a_1\leq\cdots\leq a_n=b$ such that the image $\gamma[a_i,a_{i+1}]$ is contained in a disc $D_i$ on which $f$ has a primitive (see image).
Thus $\gamma,\eta$ are homologous since they can be deformed into each other so $\int_{\gamma}f=\int_{\eta}f$.
The lemma reduces the proof of Cauchy's theorem to $\gamma$ a rectangular closed chain. Let $\gamma_i:[a_i,a_{i+1}]\to U$ be the restriction of $\gamma$ to the smaller interval. Then the chain is $\gamma_1+\cdots+\gamma_n$ a subdivision of $\gamma$. If $\eta_i$ is obtained from $\gamma_i$ by another parametrization, we have the chain $\eta_1+\cdots+\eta_n$ which is a subdivision of $\gamma$. The chains $\gamma$ and $\eta$ do not differ from each other. If $\gamma = \sum m_i\gamma_i$ is a chain and $\{\eta_{ij}\}$ is a subdivision, we call $$ \sum_i\sum_jm_in_{ij} $$ a subdivision of $\gamma$. Next we need to prove the following theorem.
Proof of Theorem:
Given the rectangle chain $\gamma$, we draw all vertical and horizontal lines passing through the sides of the chain. The lines decompose the plane into rectangles, and rectangular regions extending to infinity in the vertical and horizontal directions. Let $R_i$ be one of the rectangles, and let $\alpha_i$ be a point inside $R_i$. Let $W(\gamma,\alpha_i)=m_i$. For some rectangles we have $m_i=0$, and for some, we have $m_i\neq 0$. Let $R_i,\ldots, R_N$ be the rectangles whose $m_i\neq 0$. Let $\partial R_i$ be the boundaries of these rectangles for $i=1,\ldots,N$ oriented counterclockwise.
Assertion $1$. By assumption, $\alpha_i$ must be in $U$, becuase $W(\gamma,\alpha)=0$ for all $\alpha$ outside of $U$. The winding number is constant on connected sets so it is constant on the interior of $\partial R_i\subset U$ and not equal to zero. If the boundary points of $R_i$ are on $\gamma$, then it is in $U$. If not on $\gamma$, then the winding number is defined and equal to $m_i\neq 0$. Thus $R_i\subset U$.
Assertion $2$. Replace $\gamma$ by an appropriate subdivision. We can find a subdivision $\eta$ such that every curve occurring in $\eta$ is some side of a rectangle or the finite side of an infinite rectangular region. The subdivision $\eta$ is the sum of the sides taken with appropriate multiplicity. If a finite side of an infinite rectangle occurs in the subdivision, after inserting one more horizontal or vertical line, we may assume that this side is also the side of a finite rectangle. WLOG, we may assume that every side of the subdivision is also of one of the finite rectangles in the gird formed by horizontal and vertical lines.
Suppose $\eta-\sum m_i\partial R_i$ is not the $0$ chain. Then it contains some horizontal or vertical segment $\sigma$, so that we can write $$ \eta-\sum m_i\partial R_i = m\sigma + C, $$ where $m$ is an integer, and $C$ is a chain of vertical or horizontal segments other than $\sigma$. Then $\sigma$ is the side of a finite rectangle $R_k$. We take $\sigma$ with the orientation arising from the counterclockwise orientation of the boundary of the rectangle $R_k$. Then the closed chain $$ C=\eta-\sum m_i\partial R_i-m\partial R_k $$ does not contain $\sigma$. Let $\alpha_k$ be a point interior to $R_k$, and let $\alpha'$ be a point near $\sigma$ but on the opposite side from $\alpha_k$.
Since $\eta-\sum m_i\partial R_i-m\partial R_k$ does not contain $\sigma$, the points $\alpha_k$ and $\alpha'$ are connected by a line segment which does not intersect $C$. Therefore, $W(C,\alpha_k)=W(C,\alpha')$. But $W(\eta,\alpha_n)=m_k$ and $W(\partial R_i,\alpha_k)=0$ unless $i=k$ in which case $W(\partial R_k,\alpha_k)=1$. Similarly, if $\alpha'$ is inside some finite rectangle $R_j$ so $\alpha'=\alpha_j$, we have $$ W(\partial R_k,\alpha_j)=\begin{cases} 0, & \text{if }j\neq k\\ 1, & \text{if }j=k \end{cases} $$ If $\alpha'$ is in an infinite rectangle, then $W(\partial R_k,\alpha')=0$. Hence \begin{alignat}{2} W(C,\alpha_k)&=W\Bigl(\eta-\sum m_i\partial R_i-m\partial R_k,\alpha_k\Bigr) &&= m_k-m_k-m &&= -m\\ W(C,\alpha')&=W\Bigl(\eta-\sum m_i\partial R_i-m\partial R_k,\alpha'\Bigr)&&=0 \end{alignat} Thus, $m=0$ and $\eta-\sum m_i\partial R_i=0$. Suppose $C\neq 0$. Then $$ C=m\sigma+C^* $$ where $\sigma$ is a horizontal or vertical segment, $m$ is an integer not equal to zero, and $C^*$ is a chain of vertical or horizontal segments other than $\sigma$. Then $\sigma$ is the side of a finite rectangle. We take $\sigma$ with the counterclockwise orientation of the boundary rectangle $R$. the the chain $C-m\partial R$ does not contain $\sigma$. let $\alpha$ be a point inside of $R$, and let $\alpha'$ be a point near $\sigma$ but on the opposite side from $\alpha$. Then we can join $\alpha$ to $alpha'$ by a segment which does not intersect $C-m\partial R$. By continuity and connectedness of the segment, we have $$ W(C-m\partial R,\alpha)=W(C-m\partial R,\alpha') $$ but $W(m\partial R,\alpha)=m$ and $W(m\partial R, \alpha')=0$. Thus $W(C,\alpha)=W(C,\alpha')=0$ so $m=0$.
By the lemma and theorem, we know that for any holomorphic function $f$ on $U$, we have $$ \int_{\partial R_i}f =0 $$ by Goursat's theorem. Hence, the integral of $f$ over $\gamma$ is also equal to $0$.