Just give the team the option to take the ball side-out instead of shooting free throws when the foul occurs away from the ball. It would end hack-a-player overnight.
Yup. Especially if you want to keep the game flow similar to what it always has been: foul late in the game to slow clock. I know people say they don't like that either, but some super exciting basketball moments have occurred due to that strategy as the game gets slowed down
If you want to curb it entirely, then fouls themselves could have a more severe penalty: free throws + ball when teams enter penalty. The only reason why fouling is a strategy is because clock stops without a timeout and the fouling team almost guaranteed gets the ball after free throws. If fouling team didn't get the ball and all fouling did was give the other team a possible guaranteed 2 free points, fouling wouldn't enter anyone's strategy ever