I want to create a very large cave having the same shape as the surface. How can I hollow out (I mean leaving only the blocks at the surface untouched) the blocks inside ?
Perhaps working with two players would work. The first can replace the top layer(s) with something like wool, the second can remove everything except the wool and the first can then undo their action to leave a top layer of the original blocks. I'm not sure on the exact commands needed, but I know I've been able to replace the top layers of something before now. Perhaps //naturalize could work, as it replaces the top layers of any stone with dirt and grass. Any underground clumps can be removed more manually if needed, and removing ores shouldn't be hard if you know the IDs.
The theoretical plan: Player 1 selects the area and runs //naturalize, perhaps after turning ores into stone. Player 2 replaces all the stone with air. Player 1 runs //undo to return the top layers. Any modded blocks on top should be untouched.
Good luck! I can't be certain that this will work properly, so make a world backup before you start. Test it on a small corner before doing the whole mountain as to not have to wait ages for results.
Extra note: I would look at installing async worldedit for large jobs, it vastly improves block placement efficiency and tries to not crash your server!