"It's been my experience that an audience will forgive you almost anything at the beginning of a picture, but almost nothing at the end," observes Robert Towne, one of the distinguished interview subjects in a recent book called "The Craft of the Screenwriter." If this generalization always proved true, Towne's own "Chinatown" would have been a goner, since it was deformed by a makeshift denouement that the screenwriter himself disliked and cooked up merely to appease the morbid proclivities of his director, Roman Polanski.

Will audiences forgive the eccentric Yuogoslav humorist Dusan Makavejev for spoiling "Montenegro," an otherwise deft and savory erotic comedy, with an abrupt and miserably inappropriate kiss-off?

I think the amiable, spontaneous wackiness of "Montenegro" creates a strong case for forgiveness. After all, it's mainly the filmmaker who stands to suffer by shooting himself in the foot, figuratively speaking, only a few minutes shy of the fadeout. Rather than watch Makavejev make a botch of things, why not slip out discreetly moments after the heroine, Susan Anspach, couples in the corn crib with her earthy lover, Svetozar Cvetkovic as a Yugoslav immigrant laborer called Montenegro, and then make up an ending that seems benignly or satirically appropriate?

Now working in the West, Makavejev shot this entertaining curiosity--at times the jolliest far-fetched sex farce since Bertrand Blier's "Femmes Fatales"--in English but in Stockholm for a Swedish producer. The oddly assimilated international cast contributes to a potluck, culturally scrambled spirit of facetiousness. Anspach plays the frankly frustrated, restless American wife of Erland Josephson, a neglectful and suspiciously effete Swedish businessman who evidently spends too much time traveling to take adequate care of conjugal business. Her craving has begun to provoke unpredictable, loony behavior. For example, cooking Wiener schnitzel for dinner one day--the movie's original, and far better, title was "Wiener Schnitzel Waltz"--she startles her little girl by impulsively devouring the entire family dinner. Feeding the kids' new pet dog, she teeters on the pathological brink by threatening to poison him. To her relief, the savvy mutt can apparently read her mind and gives his dish a timely rejection.

At any rate, the behavior pattern is showing signs of desperation. The intensifying desire of this mad housewife, named Marilyn Jordan, for a wild and crazy fling is realized when a strange chain of coincidence links her to a vulgar but congenial band of immigrant Yugoslavs who operate a delightfully tacky cabaret called the Zanzibar in a dumpy part of town. Immediately welcomed as a snazzy addition to their motley, racy, mildly criminal subculture, Marilyn decides to hide out among the hospitable Yugoslavs and let her billowing hair down.

Makavejev's rambling but frequently funny scenario suggests an updated, shaggy-dog variation on Alice's plunge down the rabbit hole, which now discloses an underworld of friendly carnal wackos from Yugoslavia, intent on sustaining an inconspicuous niche for themselves in alien surroundings. Alice herself is transformed into an American update of Lady Chatterley, and Anspach proves surprisingly appealing in the role, by turns erotically impudent and vulnerable. It's as if she'd suddenly matured into a bolder counterpart of Mary Tyler Moore--willing to lend herself to a sexually explicit comic genre and yet capable of evoking a touching wistfulness within a lewd framework.

While Makavejev remains an unreliable sort of kidder, "Montenegro" at least operates on a satiric wave length that I find comprehensible and spontaneously witty. It's also visualized with considerable sensuous sophistication, a persuasive softcore turn-on when Makavejev chooses to modulate in that direction.

A specialty number devised for the cabaret's new stripper, a fresh arrival from Yugoslavia, is certainly one for the low-comedy memory album. The stripper, played by Patricia Gelin, enters draped in fronds, intended by the impresario (Bora Todorovic, who might be a missing third sibling to the wild-and-crazy guys invented for "Saturday Night Live") to evoke the native beauties of Bora Bora. She soon has a mechanical partner as she goes through her exotic gyrations: a toy tank with a rubber phallus mounted on its turret. Controlled by remote control by the impresario, tank pursues stripper around the stage until it finally corners her. I don't maintain that this routine rivals the fantasies of Busby Berkeley at his most inspired, but it was certainly one-of-a-kind.