a closed cell foam might work. Closed cell foams do not absorb water.
What I’ve seen in the real world is even those closed cell foams hold water/moisture against a surface. So while the foam itself may not absorb the water/moisture, it will create voids and hold water/moisture that finds its way in. You can see this in a lot of houses that have been sprayed, predominately in older houses that were not sealed as tight as some of the new ones.