Oh the US is no model of excellence, for sure.
There are painless methods of killing people but the use of them in judicial executions has been hampered by other considerations. A big one is cost. A method developed by the euthanasia business and used for elective procedures in some Swiss clinics is the nitrogen chamber which is even said to provide a pleasant death experience. Very expensive though.
There’s been some debate as to how painless the guillotine was. France was the last country to use it judicially, and they last rolled a head in 1977, so there’s been no opportunity to scientifically evaluate the method since then. Another problem with it was said to be its affect on those who had to clean up afterwards. There’s no denying its swift and unequivocal nature though.
On balance, I’d probably favour the decisiveness and simplicity of the good old pistol shot to the back of the head. Swift and sure, and any pain would be no worse than a mini-migraine and extremely short lived, in the most literal sense of the term. The method has the added advantage of a 9mm pistol round only costing about two quid (probably even less when bought in bulk). The single gunshot was used in America for a while but eventually abandoned because not many people wanted to pull the trigger. Interesting that they have no shortage of people who are happy to strap someone into an electric chair but far fewer willing to shoot someone in the head. It's even more interesting that executioners have little problem with shooting people as part of a firing squad. It's doing it alone they don't like. Another consideration that made shooting unpopular was that the exit wounds often precluded open cask funerals without some challenging cosmetic work by undertakers. The prize for the most flamboyant use of gunfire has to go to Thailand who, until 2002, executed prisoners by machine gun.
Of course, all of this becomes academic when considered comparatively against the pain and suffering caused by long term incarceration, which is the only alternative proposed by the anti-CP fetishists whose opinions on the subject, as we can see from this thread, are often cruel and perverse.