I don't think the bar is there for strength, but rather to keep the shackle from slipping out of the halyard eye splice when it is disconnected.
If it is a roll pin, then driving it out is a reasonable thing to do, but do inspect to be sure it isn't a solid pin with shoulders... if so, driving it out will be destructive.
The best thing is to simply cut off the end of the halyard and splice the new shackle into a new eye.
PS For those who advocate tying the halyard into the headboard of the mainsail
, well, on some boats that is not practical due to the height of the stacked mainsail
. Some folks, us included, use the halyard for several tasks besides hoisting the sail, and an easy, one handed attachment is a good thing.