Depends on what's on the outside, water has a thermal conductivity of ~0.6W/mK, glass about 0.8, with plastics varying from 0.2-0.5. So if it's glass there shouldn't be much realistic build up of heat past a point, if it's plastic there will be a bit of build up but it still will take heat not too much worse than water does. But given M.2 slots are limited to 7W of power(Practically a thin small flat plate of metal would be enough of a heatsink here), and water has a thermal capacity of 420J/100ml, even at the max 7W you'd get a minute between each 1 degree celsius rise at full power if there it were 100ml and there was no dissipation through the exterior, so even if it's like 25ml it probably wouldn't be an issue anyway 99% of the time.