Walter Matthau is basically a Codger.

Over the years he has bent so many movie villains and character parts into his gruff but lovable shape that he has made the Codger an American hero. Imagine a 60-year-old man who walks like Groucho Marx trying to sneak into the house at 3 a.m. and has a face that looks like someone slept in it -- and still gets the girl.

"For that I blame my wife Carol," Matthau said. "I get some part, I tell her, I can't do that. I tell her, most people my age are dead. I tell her, I'm too homely. But she says, you're amazing, you're the most handsome man I ever saw, you're like a young Olivier."

He shrugged his cheeks.

"How can you fight that? My first wife thought I looked like Wallace Beery."

For about four hours yesterday Matthau and Jill Clayburgh stood on the sidewalk in front of the Supreme Court building to file a 20-second shot for "First Monday in October," the movie version of the Henry Fonda-Jane Alexander stage hit about a liberal male Supreme Court justice and a conservative new woman justice who fall in love.

Also on the scene were the unforgettable Martha Scott, co-producer, and the veteran director Ronald Neame, who was a cameraman for Alfred Hitchcock's first sound film in 1928, and Paul Heller, the other producer, and eight vanloads of technicians; hairdressers, press agents, grips and gaffers and people who kept running down to Eddie Bauer for more mittens.

Matthau wore a scarf over his ears and under his fedora when the camera wasn't rolling. Eventually someone brought him a Russian-type down helmet. He liked it so much he forgot and wore it during a take.

Twice, three times, four times the stars had to climb out of a taxi and start up the steps toward their happily-ever-after finale. But for every take Clayburgh's hair had to be fluffed and her after-ski boots had to be changed for shoes. Then they'd get in the cab, which was mounted on a flatbed so the camera could shoot through the windshield, and go around the block, stop, get out and start up the steps.

Huge spotlights on wheels, Brutes, fought back the shadows left by a brilliant sun. Camera dollies and sound dollies shifted back and forth across rivers of cables. Extras strolled, again and again, through the background. The cabbie, also an actor, sang out her line over and over: "Hey! What about the meter?"

Heller scowled at the sea of equipment, brought here to get the real flavor of the Supreme Court facade and neighborhood. "This is costing us $40,000 a day," he said. "At the studio it's $30,000. We built a whole Supreme Court chamber out there."

The picture was supposed to start last August and finish in October, but Clayburgh had a miscarriage, delaying the windup until now. This week's work completes the shooting. The film will open on the first Monday of next October.

Out on the pavement, Matthau was shadowboxing with Clayburgh. They have been getting along so well that Ehller's looking for another picture for them. That boxing stuff goes back a long way: Matthau used to teach 5-year-olds boxing and basketball on the Lower East Side in 1940, when he was with the WPA. He was born there. He can still do his East Side accent.

"I used to imitate the landlady when I was 3," he said. "My mother thought I was hilarious. Then I did recitations in school for Miss Creedon."

His first job was selling drinks in the aisles at an Italian theater, and later he even got onstage at the age of 11 (for 50 cents a performance) in a Yiddish language theater.

"It used to study the dialects, and I'd watch the actors night after night.

The ear wasn't bad," he added quietly, meaning that his mimicry is one of the most deadly in the business.

After a stretch in the Civilian Conservation Corps, he wound up in the Army Air Corps, flew combat as a B-24 gunner over Europe, studied journalism at Columbia and in 1948 landed a part in "Anne of the Thousand Days" on Broadway. It was his Nathan Detroit in "Guys and Dolls" that caught the eye of Neil Simon and brought Matthau to "The Odd Couple" and the coronation of the Codger.

A curious character, the Codger. He started as a bullwhipping heavy in a 1955 western, moved up to the oddly sympathetic maniac in "Charade," turned lovable in "Hello, Dolly" and emerged all growling and fuzzy in the films he did with Glenda Jackson. It was as though America needed a new kind of man, tough but feeling, who could stand up to the new woman personified by Jackson, Clayburgh and Jane Fonda.

Most of all, the new man had to be unpretty, maybe even a bit overweight, maybe even a bit of a slob, but less slob than codger. The Codger formally took over as America's role model from the pretty hero in "The Odd Couple."

"I wanted to do Oscar, the big guy, as the good cook, the finicky one. Would have been a nice switch," muttered Matthau as he stirred his lasagne into mush on the trailer stove during a lunch break. The lasagne was cold and the microwave oven didn't work, so he was warming the stuff in a pan with a little water. He did look like Oscar, at that. (His tastes in food are catholic. Once the CCC boys started a rebellion over the food, and Matthau couldn't understand what the problem was. He thought it tasted great.)

"I don't know as there's any special pattern to this persona thing," he mused. "I'm a character actor, and suddenly this role of Oscar just crystalized into a commercial hit. There used to be a lot of French actors who were big as middle-aged men: Raimu, Gabin, Louis Jouvet."

But they didn't get the girl.