In MLB, Jim Tobin of the Boston Braves hit 3 consecutive home
runs in a game against the Chicago Cubs on May 13, 1942. The home
runs came in the 5th, 7th, and 8th innings.
Guy Hecker of the 1886 Louisville Colonels in the American
Association also hit three home runs in a game but they weren't in
consecutive at bats. All three were inside-the-park homers.
Tobin and Hecker are the only two pitchers to hit three home
runs in one game.