South Africa ended day 3 at 54 runs for the loss of two wickets in their second innings after Bangladesh were bundled out for 320 at Senwes Park in Potchefstroom on Saturday.
The Proteas were 230 runs ahead of Bangladesh.
No 3 batter Hashim Amla was not out on 17 while middle-order batsman Bavuma scored an unbeaten 3 before bad light stopped play.
Bangladesh paceman Shafiul Islam and Mustafizur Rahman took one wicket apiece.