"Mohammad, Messenger of God," the film that became an issue in yesterday's hostage-taking groups of Hanafi Muslism, has taken eight years to reach the screen precisely because producer-director Moustapha Akkad wanted desperately to avoid any possibility of disturbances.

Reached yesterday in New York, the 44-year-old Syrian-born, Hollywood-trained director said:

"I am willing to show this movie to any Moslem and if they don't like it, I am willing to burn it. If there is any offense, I promise I will burn it."

Akkad said he had never heard of the Hanafi sect and claimed to have already shown "Mohammad" to approximately 10,000 Moslems, including Herbert Muhammed and Muhammad Ali, and "nobody objected."

The three-hour film, which quickly was pulled from its opening day showings in nine theaters in the New York and Los Angeles areas after reports of the incidents in Washington, had run into similar trouble at its world premier in London last July.

Akkad was persuaded to change the film's title to "The Message" just 72 hours before its opening because of telephone threats to the theater.

The problem both in London and in the United States is that on orthodox interpretation of the Koran strictly prohibits any pictorial representation of Mohammad, or even of his shadow. Anthony Quinn, the film's star, plays Hamza, the Prophet's uncle.

And even though the Prophet is not shown on the screen, reports from London say that Moslems in the audience react strongly at even the suggestion of his portrayal.

Religious difficulties plagued "Mohammad," which cost $18 million and was shot in both English and Arabic version, almost from its inception.

Akkad, who studied film at both USC and UCLA and apprenticed with Sem Peckinpah on the classic western, "Ride the High Country, first got the idea for this film, which he hoped would contribute to the understanding of his religion, in 1969.

He got approval from several Moslem countries, but not from conservative Saudi Arabia, which was upset at what it felt was exploitation of the Prophet. When Akkad consulted with Moslem authorities in Pakistan, a rumor that Charlton Heston was to play the Prophet caused a series of street riots.

A year and a half was spent in Cairo preparing the screenplay in consultation with Al Azhar University, Islam's most important center of learning, which Akkad called "a kind of Vatican for the Moslem world." The script, which deals with the founding years of Islam, was translated into Arabic and approved, page by page, by religious authorities.

Filming began in southern Morocco, where $700,000 was spent on a replica of early Mecca. However pressure from conservative religious forced a 3,000-mile move to Libya, which was friendly to the film because its principal financing came from that country and Kuwait.

Even in Libya, Akkad ran into problems with the 8,000 Moslems he used for extras in the battle scenes. First, none of them wanted to play the losing pagans. Then, when historical accuracy called for the Moslems to retreat after one fight, none of them wanted to do that, either.

According to the film's publicists, nine previous films have been produced in Arabic dealing in some way with the life of the Prophet. Some sources say this film may have been particularly offensive to orthodox Moslems because of its ecumenical nature, its stressing of the similiarities of Islam with Judiasm and Christianity.

Early reviews of the film in this country have stressed what Variety called Akkad's "deep deference to Moslem sensibility," a deference so great that many critics felt it got in the way of any dramatic intensity.

Raymond Coffey of The Chicago Daily News complained, for instance, that "there is a heavy dose of didactism in the film, with a lot of dialogue sounding like a catechism lesson in the Moslem attitudes on racism, the status of women and so on."

Besides Quinn, the best-know actors are Michael Ansaraas as a principal adversary of the Prophet's, and Irene Papas as his wife. Irwin yablans, brother of Frank yablans, former president of Paramount Pictures is in charges of distributing "Mohammad" in the United States.

He told the trade press last week that he was going to show the film only in "meticulously selected" theaters. And Akkad, interviewed last year in Chicago, said his aim in making "Mohammad" was "art, definitely art, not politics."