It rains and I have water under the mast step. Thinking drill a hole 2' up and pour some foam inside the mast via the hole. Rain water to exit out the same hole.Would it prevent rain getting below?
Most foam absorbs water, even though it may be stated to be 100% closed cell. Even professionally applied foams not available for DIY are not 100% closed cell. Water absorption will mean the inside of the mast is permanently wet, very bad for corrosion. Why not do as you suggest but pour in epoxy? Not more than half an inch at a time to avoid exotherm cracking.
I thought all keel stepped masts were made with such an arrangement. Worth checking around to make sure thaere is not a (blocked?) hole there already.
It is difficult to accurately place expanding foam and a drain hole at the right level.