That depends entirely on what you consider intense local work. Just because you are not compiling doesn’t mean running your 15 microservice stack locally is not intense.
I'd argue that _most_ programmers or even data analysts don't need more than 8 GB to perform their actual work.
But realistically they need 16+ anyway because of opening 200 browser tabs, memory-heavy IDEs, etc. 32 or 64 is nice for sure, but definitely not needed for actual "work" workloads for the most part.
Most Linux distro suggest you to setup swap so instead of crashing it could use the swap. I personally don't use swap, because if something is consuming too much ram I most likely want it dead.
I don't know what are you compiling, but requiring more than 16GB of ram for compiling something sounds lazy and unneeded. Likewise you can use a browser extension which reclaims ram from unused tabs.
I can understand the need to have 64gb to do video editing or rendering, but most of the times we need that much ram is because our software is badly written and we don't want to face the problem, not because of the complexity of what we're doing.
Swap is still useful to move stuff out to disk that _never_ gets accessed again.
Which distro and can't you configure this? (Genuinely interested)
Also if the MacBook is better, than you should use that device. It's your "conclusion".
I use a dual xeon, 64GB Linux desktop which performs reasonably well.
A colleague runs a Linux machine with 16GB of ram. Compiling the same project can cause OOM issues for him and the kernel starts whacking processes.
Even if he closes all non-essential processes, his builds run 10x as long as mine due to memory constraints.
My main point here - let’s not pretend your 4GB machine is being used to do any intense local work.
The inverse of this is seen on my Intel MacBook Air and my colleague’s M1 MacBook Air. The compilation time for our code is 35 minutes or more on my machine and only 3 minutes on the M1.