Upgrade the machine imho. I got my Asus Vivobook with a 4k series Ryzen 7, 16GB of DDR4-3200, and a 1TB Intel nvme SSD for less than $600.
I know coding isn't super hw-intensive, but the differences in the newer processors would be worth it to upgrade in my opinion. Not just faster/more cores but more efficient, meaning they run cooler and give longer battery life when away from AC power (if it matters).
The Ryzen 4700U chip in this laptop is apparently ~equal to the Ryzen 7 2700X desktop chip that I was using prior to it, and this laptop never even feels warm, much less hot.
Edit:a new laptop will obviously cost more than some RAM and a 2TB SSD, but a 2TB SSD will likely cost half of a new system (although it wouldn't have a 2TB SSD either, but a 1TB is do-able).