I'm no military buff, but surely for bullying pirates and 3rd worlders, a battleship is the most economical way to do it safely right? Those shells can't be that expensive (on a military scale), maybe a few thousand a shot as compared to missiles that cost hundreds of thousands. For leveling an area with non-nuclear ordinance, having a battleship parked 20 miles off the coast with the battle fleet just shelling a pirate port to rubble seems like the way to go.
For near peers it's stupid for the most part, but like the A-10 it might not be too bad of an idea, since 75% of the Navy's job is handling pirates, uppity terrorists and cartels, and the other 25% is making sure every other country doesn't fuck around by promising they'll find out if they do. Plus they're just fucking cool, major PR showing off those walls of flame as guns so big you could crawl into the barrel shoot small cars at the enemy.