I suspect you don't need to be stamped in and clear customs if you are in transit between two other countries (not sure though, so others might be able to advise). If you are travelling from Windhoek to JNB to CPT then you will need to clear customs in JNB and recheck your bags.
Unless you need a visa, the South African authorities will give you a half page sticker on arrival which allows you to come and go as you please. Then you get small square and round stamps on each entry and exit. You won't go through many pages, even if you do land.