If you wish to immigrate to South Africa with your foreigner partner, for this reason, you do not need to get married, as there are options to reside in South Africa on a suitable visa.
If a South African and a foreigner are in a permanent relationship, then a life partner visa will be applicable.