“The anti-fake-news law that came out just before the election was very clearly designed to suppress any criticism of the ruling party or of Najib.”

Now, the pace and extent of change are in the hands of Mr. Mahathir and his new government. And if there is concern, it is at least partly because Mr. Mahathir, who previously ran the country from 1981 to 2003, was long known to find one way or another to jail his critics.

Mr. Mahathir’s campaign-speech commitment to free speech did seem to waver right after the election, when he suggested that the fake news law needed to be reviewed rather than scrapped entirely, as his coalition had pledged during the campaign.

But his cabinet officials maintain that the law, which Mr. Mahathir himself had been accused of violating during the campaign, will be repealed.

And Mr. Mahathir has sent other signals that he will uphold free speech. When the police in Langkawi arrested a man on charges of insulting Mr. Mahathir after the election, the new prime minister said he disagreed with the man’s prosecution.

Mr. Gan and the co-founder of the Malaysiakini site, Premesh Chandran, were charged in 2016 under the Communications and Multimedia Act for publishing a video that criticized the former attorney general over his handling of the scandal at 1 Malaysia Development Berhad, a state investment fund. That attorney general, Mohamed Apandi Ali, has been removed and could face charges for protecting Mr. Najib.