It won't be polytropic or even quasi-static. The gas will suffer an irreversible expansion, and the final state of the system can be determined.
Assuming that the spring is initially at its unextended length, the force exerted by the spring on the piston during the process will be $-k(x-x_0)$, where x is the location relative to the left wall of the cylinder, and $x_0$ is the its original location. But, if A represents the area of the piston, then $-k(x-x_0)=-\frac{k}{A}(V-V_0)$ where V is the gas volume at time t, and $V_0$ is the initial gas volume. So, if we apply Newton's 2nd law of motion to derive a force balance on the piston at any time t, we obtain: $$F_g-\frac{k}{A}(V-V_0)=m\frac{d^2x}{dt^2}=\frac{m}{A}\frac{d^2V}{dt^2}$$where $F_g$ is the force exerted by the gas on the piston at time t and m is the mass of the piston. If we multiply this equation by dV/dt and integrate with respect to time, we can obtain the work done by the gas on the piston (its surroundings) up to time t:
$$W_g=\frac{k}{2A}(V-V_0)^2+\frac{m}{2A}\left(\frac{dV}{dt}\right)^2$$In this equation, the first term on the right hand side represents the elastic energy stored in the spring, and the second term represents the kinetic energy of the piston. Even though the piston may oscillate back and forth during this process, eventually, because of viscous damping forces within the gas, the piston will come to rest, and the system will be in its final equilibrium state. At that point, the work done by the gas will be given by:$$W_g=\frac{k}{2A}(V_f-V_0)^2$$where $V_f$ is the final equilibrium gas volume. The final pressure of the gas will then be given by: $$P_f=\frac{F_{gf}}{A}=\frac{k}{A^2}(V_f-V_0)\tag{1}$$
Next, applying the first law of thermodynamics to the system, we have $$\Delta U=nC_v(T_f-T_0)=-W_{gf}=-\frac{k}{2A}(V_f-V_0)^2$$But, from the ideal gas law, it follows that $$nC_v(T_f-T_0)=\frac{C_v}{R}(P_fV_f-P_0V_0)$$Therefore, we have:
$$\frac{C_v}{R}(P_fV_f-P_0V_0)=-\frac{k}{2A}(V_f-V_0)^2\tag{2}$$Eqn. 2 can be combined with Eqn. 1 to provide a single quadratic equation for calculating the final volume $V_f$ (and then the final temperature and final pressure).