https://www.cpubenchmark.net/compar...-12700K-vs-Intel-i7-13700K-vs-Intel-i7-14700K
As you can see there is a significant jump in single thread score from 12th to 13th gen. That is the increased cache and clock boosts at work. The difference between 13th and 14th gen is minor, but you do get a little more cache and cores with the 14700k. Whether that is worth $40, not sure. It is the second fastest (really 3rd or 4th if you count the KS models) chip available for the socket.
What you really have to ask is within the next 2 years or so are you likely to want to upgrade and spend the money on a processor? 12th gen chips came down in price a lot from launch. But that may have something to do with excess availability and AMD being a valid option for builders. 13th and 14th gen haven't yet seen that, but when 15th gen launches later this year they may drop in price. That is what I am counting on. If I can pick up a 14700k for under $300 I will do so. After enough time any reasonable upgrade is going to require a new motherboard. But if you buy the 13700k or 14700k now, then I would not upgrade for a number of years.
DDR4 is end of lifecycle. There are 4400 and 4800 kits that are pretty reasonable, but there is no guarantee any particular CPU will be able to run them that fast. However, spending more money on DDR4 is a bit silly when you already have a significant quantity. Saves you about $120 or more if you stick with what you have. As I said, for gaming only, memory speed isn't that important to Intel. If you keep the DDR4 you have now you certainly will have to replace it when you move beyond LGA1700, LGA1861 should be available later this year and that will be a DDR5 platform only.
DDR5 has dropped enough in price and if you want to go after the higher end stuff there is DDR5 7200, but it will be expensive Expectations are that the DDR5 will top out around 8000 or so for the consumer so in a few years time that may be as cheap as DDR4 3200 is now. (DDR4 started at 2133, and now the standard is 3200, with high OC memory in the 4000s)
Spend the minimum now and do a full upgrade sooner. 12600k might be the way to go there.
Spend for a full rebuild now and keep it for a number of generations of hardware improvement.
Compromise and do small refreshes. (Closer to what I do, but I like to tinker)