The question then, is where is the breakeven point? What if you had a horrible punter, or there was an injury?
Thankfully, this is a fairly trivial exercise. All we are looking for is the yardline where the opposing team hits 3.71 expected points. Based on my expected points model, this happens at the 35 yard line. So, if you are confident your punter & coverage team can get a minimum net 34 yard punt, you should go ahead and punt it away. If not, you should either be looking for a new punter, curse the wind, or concede the safety.
This breakeven point does not change depending on the yardline the punting team is on. In actuality, it is far worse to concede a safety from the 8 yard line, as you still only need to get it to the 35 to break-even. This would be a net 28 yard punt.
Alternatively, if you have a big kicker, the breakeven point to consider conceding a safety & kicking would be getting the kickoff to the opponent's 32 yardline. This would be a massive kickoff.
Let's look at how often teams hit those breakeven points: