Blacks in riot-torn slums near Johannesburg defied official restrictions today and buried their dead at politically charged funerals that included prohibited processions, songs and displays of slogans.

The death toll in South Africa's week of race riots rose, meanwhile, to 39 as police shot a man in a new flare-up of violence. A police spokesman said the man was shot after a group left a funeral and set fire to a house belonging to the chairman of the black community council of Katlehong, a township near here. Another member of the group and a policeman were badly injured in the clash, the spokesman said.

Many blacks regard members of the township councils as collaborators of the white administration, and they have been principal targets during the riots.

The biggest of the funerals was here in Daveyton, a township near the white city of Benoni, where a crowd of more than 3,000 defied government banning orders and turned the occasion into a black nationalist rally, openly singing revolutionary songs in support of the black guerrillas.

The police did not intervene in Daveyton, as the chanting crowd moved through the streets of the township carrying four coffins shoulder-high to the cemetery, but a task force stood by with three armored vehicles.

The rioting has coincided with the inauguration of a new national constitution, which the government of president-elect Pieter W. Botha claims is an important reform in its segregationist system called apartheid, but which the black nationalists reject as a sham.

Today's funerals took place after the government announced a series of bans and restrictions on meetings yesterday, presumably to prevent further political agitation.

Meetings planned to commemorate the death in detention seven years ago of black consciousness leader Steve Biko were forbidden, and tight restrictions were announced for the funerals today of blacks killed during the week of rioting.

Under the restrictions, political speeches were prohibited at the funerals. The regulations also prohibited banners with slogans and specified that the coffins should not be carried through the streets and that there should be no street processions.

In Daveyton, these restrictions were ignored at the funeral of four young blacks killed when student demonstrators clashed with police in the township last weekend. One of the dead, Joyce Nyamza, was only 9 years old.

Huge banners with black nationalist slogans were unfurled at the service, which was held at an athletic field. For two hours before the funeral, a crowd of more than 3,000 chanted slogans and sang revolutionary songs.

One of the songs, extolling the underground guerrilla wing of the banned African National Congress, called "Spear of the Nation", had the words: "Go well, spear of the nation. We of the spear are ready to sacrifice ourselves to kill the Boers the white Afrikaners who dominate the government ."

The South African Supreme Court has ruled that support for the African National Congress is high treason, and has imposed sentences of 15 years' imprisonment for the offense.

Speeches at the funeral service, which was led by Bishop Desmond Tutu, one of the foremost spokesmen for black South Africans, were openly political.

"We call on the authorities to hear us when we tell them apartheid is evil," Tutu said in his oration. "We are the victims of a vicious system. Let them hear us when we warn responsibly that we cannot go on like this."

There will be recurring trouble, Tutu warned, if the "real leaders" remain in prison and exile, while the government continues to "present us with other leaders who we think are collaborators with an evil system."

After Tutu's oration, the big crowd swarmed out of the athletic grounds with their banners, lifted the four coffins shoulder-high and jogged for several miles through the streets with them, chanting slogans and singing revolutionary songs as they went.

The police task force kept in the background. "They can do what they like so long as they keep to themselves," one security man said. "But if they start causing disruption in the township, end of story."