If you want 3 threads engagement at 40 tpi, you need a hole 3x(1/40) = 0.075" deep, plus whatever you need for the bottom tap to clear (1 thread or 0.025"?). So, a hole 0.1" deep, assuming that doesn't go too deep into the barrel wall. The pressure is less that at the breech, but you still want some metal there.
Don't take this answer as the truth, my hope is only to goad someone who knows the right answer to chip in. You could also work backwards from a safe wall thickness and see how far you can drill in to get maximum thread engagement, if it works out better.