The correct equation to start with in your analysis is $$dU=TdS-PdV\tag{1}$$ This equation describes the mutual variations in U, S, and V between two closely neighboring (i.e., differentially separated) thermodynamic equilibrium states of a substance. It doesn't matter how tortuous or extensive the process path was that took the substance from its initial thermodynamic equilibrium state to its final thermodynamic equilibrium state as long as, in the end, the two states are very close together. (So imagine two paths through your neighborhood, one which is very tortuous and takes you from your house through many streets before coming back to your immediate neighbor's house, and the other which goes directly from your house to his house.) Eqn. 1 also applies even if the intermediate states between the initial and final closely neighboring equilibrium states were the ends of a very tortuous irreversible path. Recall that, in determining the entropy change for an irreversible path, the two key steps are
- Using the 1st law of thermodynamics, establish the final thermodynamic equilibrium state
- Totally forget about the actual irreversible process path, and devise an alternate reversible process path between the same two end states. Determine the integral of dq/T for that alternate reversible process path.
So, in the present case, for Eqn. 1, even though the process path between the two differentially separated end states may have been tortuous and irreversible, the equation was derived for the same two end states using an alternate reversible path. So this equation applies to all differentially separated thermodynamic equilibrium end states of a substance.
As @GezaLaTex has pointed out, when expressed in terms of dT, dV, and the definition of Cv, Eqn. 1 for the internal energy change becomes:
$$dU=C_vdT-\left[P-T\left(\frac{\partial P}{\partial T}\right)_V\right]dV\tag{2}$$
In most cases, Cv is going to be a function of specific volume, and we are only going to know Cv in the ideal gas limit of large specific volumes V. So, to employ Eqn. 2 to determine $U(T_2,V_2)-U(T_1,V_1)$, we must use Hess' law and employ a path that passes through this ideal gas region. This can be done by writing $$U(T_1,V_1)\rightarrow U(T_1,\infty)\rightarrow U(T_2,\infty)\rightarrow U(T_2,V_2)\tag{3}$$
So, following this prescription, we have:
$$U(T_2,V_2)-U(T_1,V_1)=-\int_{V_1}^{\infty}{\Pi (T_1,V)dV}+\int_{T_1}^{T_2}{C_v(T,\infty)dT}+\int_{V_2}^{\infty}{\Pi (T_2,V)dV}$$
where $$\Pi (T,V)=P-T\left(\frac{\partial P}{\partial T}\right)_V$$