Prime Minister Pieter Botha has offered to consider changing South African laws barring sex or marriage across the color line.

His statement startled politicians and churchmen yesterday. The Immorality Act and the Mixed Marriages Act are widely regarded as pillars of the apartheid policy of separation of the races.

But at a congress Tuesday night of his ruling National Party, Botha said the government was prepared to consider suggestions for changing the acts.

"No act can be regarded as a holy cow," he said. "I will not tolerate any laws on the statue book that insult people."

Although there were biblical examples of mixed marriages, the prime minister said that from a practical point of view they remained undesirable. "But I concede there is a problem where people really love each other and want to get married," he added.

Turning to the Immorality Act, which bars sexual intercourse between people of different races, Botha said: "Immorality of any sort must be fought in a Christian country. If we can improve the Immorality Act, not only in connection with people of different races, but in all areas, I will be amenable to suggestion."

Botha's statements apparently are part of his recently launched effort to promote better race relations in South Africa.

It is an effort which, observers say, may bring him political trouble, especially from the right wing of his party and from white ultraconservative groups. The two elements are increasingly unhappy with Botha's conciliatory, mildly reformist response to the country's black majority.