Read the book Jefferson's War by Joseph Wheelan before you assume to say I am incorrect. I have facts to back me up.
No listen I've read a lot about the barbary corsairs.
What the USA did to project their power from the other side of the atlantic to sink corsair ships and bombard corsair ports is impressive and an achievement worthy of respect.
But the idea that as you said that no european power had ever thought of doing the same and it wasn't until the usa had proved it was possible that the europeans started going after the corsairs is just not true.
Did european states buy off corsairs, yes they did. Did they negotiate deals to get their prisoners back peacefully yes they did. Did they also bombard the ports and sink the ships, yes they did that too.
Between the capture of Tunis, Algiers and Tripoli by the Ottomans and the barbary wars with the United States, those three ports were bombarded and attacked by european christian powers precisely 27 times. 27!
It was not an idea that 'even the British navy had failed to think of-'.