In a part of the world where the primary allegiance is to the family, death often brings a truce in political battles.

Thus the mysterious sudden death in Cannes, France, on Thursday of Shahnawaz Bhutto, 27, the youngest son of former prime minister Zulfiqar Ali Bhutto, triggered an outpouring of sympathy from the martial-law government of Mohammed Zia ul-Haq despite its concern over the political charisma that the Bhutto family still exercises in this country.

Moreover, Bhutto's daughter and political heir, Benazir Bhutto, was told there would be no restrictions on her return from more than a year of voluntary exile in London, even though she had sworn to avenge her father's hanging by Zia's government in 1979.

"We thought we must share their sorrow," Zia explained in a brief interview. "I have believed you should not take politics to one's blood. There are human relations.

"You can have differences of opinion," he added, "but on occasions of a death in a family the sorrow transcends all barriers."

In that mood, Zia and Prime Minister Mohammed Khan Junejo led the list of government officials offering condolences to Shahnawaz Bhutto's mother. In official statements, Zia offered "heartfelt sympathies" while Junejo said the death "caused me untold grief and dismay."

Shahnawaz Bhutto will be buried within 10 days, as soon as French authorities release the body and arrangements can be made to ship it to this country, on the family estate in the village of Larkana, about 150 miles north of Karachi.

The ceremony will take place in an atmosphere of political tension mixed with feudal obeisance, as old servants and farmers from that vast area of the Sind join political figures in paying their final respects.

Already, members of Bhutto's banned Pakistan People's Party are making plans to turn the funeral into a political rally, and Pakistani security forces are countering by arresting selected People's Party leaders.

Shahnawaz Bhutto's mother, Nusrat Bhutto, is ill with cancer in France and will not attend. Neither will his brother Murtaza Bhutto, 30, who like Shahnawaz headed a shadowy terrorist organization named Al Zulfiqar after their father, which is dedicated to overthrowing Zia.

Both brothers were convicted in absentia by Pakistani courts of taking part in the 1981 hijacking of a Pakistan International Airline plane and of the murder of one of the passengers, a Pakistani diplomat.

Benazir Bhutto, 31, eldest daughter of Bhutto, who retains her touch for the rough-and-tumble of Pakistani politics despite her Radcliffe and Oxford education, will return to a split party. Some members have bolted to run for the nonpartisan elected assembly that was set up as a transition to constitutional government.

"She almost has to come back," said one long-time diplomatic observer of Pakistani politics. "That People's Party crowd in London is divorced from reality. If she stays with them for too long, she'll have trouble arranging a comeback."

But Pakistani government officials and journalists point out that Benazir Bhutto will be forced to walk a narrow line on her return.

She has to be fiery enough to energize her political supporters, many of whom have become dispirited with the absence of a Bhutto figure in the country and the increased popularity of a national assembly without any People's Party members.

If she comes across too strong, however, she runs the risk of being slapped in jail by the Zia government. She was allowed to leave the country to get medical treatment for a serious ear infection in late 1984 and more recently has been living in London. Before that, Benazir Bhutto had been under house arrest or in jail in Pakistan since her father's execution in 1979.

Pakistan's security apparatus has begun preparing for the political fallout from her return. An independent Pakistani newspaper reported today that two opposition leaders have been arrested in the Sind, the province where the Bhutto family's political clout is the greatest.

One was Makhdum Khaliquzzaman, the acting president of the People's Party who was making arrangements for the funeral. The other was Mir Ghaus Bakhsh Bizanjou, chief of the Pakistan National Party. Other People's Party leaders, moreover, have been barred from entering Sind Province to take part in the Bhutto funeral.

It was clear from the messages of condolence made public here, however, that the initial government concern was for the personal loss to the Bhutto family and only secondarily for the political fallout.