Stagnate Gas
When the gas is stagnate, view the system as though it is an extended surface (from compressor to outlet). Take the heat transfer inside the tube as having no radial component. Develop the differential equation along the tube $z$ as
$$
\frac{d}{dz} k_G A \frac{dT}{dz} - \frac{P}{R'}\left(T - T_\infty\right) = 0 \\
\frac{1}{R'} = \left(\frac{1}{h} + \frac{w}{k_w}\right)^{-1}
$$
where $A$ is the cross-sectional area and $P$ is the perimeter length at a given $z$.
Allow that gas thermal conductivity $k_G$ is constant to obtain
$$
\frac{d^2T}{dz^2} - m^2\left(T - T_\infty\right) = 0 \\
m^2 = \frac{P}{k_G R'A}
$$
where $P$ is the (outer) perimeter of the tube, $w$ is the tube thickness, $k_w$ is the thermal conductivity of the tube, and $A$ is (inner) circular area of the gas at a position $z$ along the tube. For this geometry
$$
\frac{P}{A} = \frac{2\pi r_o}{\pi r_i^2} = \frac{2r_o}{r_i^2}
$$
Fix the temperature at the compressor. Three solutions are obtained for the temperature along the (center of the) tube $T(z)$ depending on the boundary conditions. One is when the end temperature is fixed, one is when the end is insulated (no heat flow), and the final is when the end allows heat flow. Examples are found at this link to MIT course notes.
The system you have is modeled as one where heat flows out of the end. To first order, the heat flow out the end is
$$
\dot{q}_L = -\left.k_G\frac{dT}{dz}\right|_L = \dot{m} \tilde{C}_p\left(T - T_\infty\right)
$$
This adds complexity to the simple answers and requires analysis at an advanced level. In short though, as you increase $\dot{m}$, the temperature $T_L$ will become closer to $T_o$. The relationship has nothing that lends itself to be "optimized". In short, you cannot find a relationship to obtain a minimum $T_o - T_L$ based on setting a maximum $\dot{m}$ because $T_L \rightarrow T_o$ as $\dot{m} \rightarrow \infty$.
Gas Flow - Well Mixed Radial
When the gas flows along $z$ and is well-mixed along $r$, we replace the term $-k_G A dT/dx$ by $\dot{m}\tilde{C}_p T$ to obtain
$$
\dot{m}\tilde{C}_p\frac{dT}{dz} - \frac{A}{R'}\left(T - T_\infty\right) = 0 $$
This first order differential equation can be solved for $T(z)$ with the boundary condition $T(0) = T_o$. Here again, the system has no optimization between $\dot{m}$ and $T_o - T_L$. The same limits apply as above.
Gas Flow - Non-Mixed Radial
When the gas is not well mixed in the radial direction, the temperature profile inside the tube will not be uniform along the radius. To continue with the model of an extended surface, we will have to include an internal convection coefficient. This gets ugly fast.
The simpler system in this case is to model the tube as a heat exchanger. The first order relationship is
$$
\dot{q} = \dot{m}\tilde{C}_p\left(T_o - T_L\right) = \varepsilon U A \left(T_o - T_\infty\right)
$$
where $\varepsilon$ is the efficiency of the exchanger, $U$ is its overall heat transfer coefficient, and $A$ is the (inner/outer) tube area. This is what is called an NTU analysis.
Even in this case, one does not have a condition to optimize. As $\dot{m} \rightarrow \infty$, you will find that $T_L \rightarrow T_o$.
I hope this gives you a useful starting point. In summary, there is nothing to optimize in a balance of $\dot{m}$ and $T_o - T_L$.