It took the dominant duo just 90 minutes to claim their medals as they won with three ends to spare.
They had swaggered into the final full of confidence following their dramatic last-gasp win over Auld Enemy England in the semi-final.
Skip Marshall - a record 19-time world champion - celebrated that victory with an emotive first-clenched gesture to the crowd.
And he was still pumped up as he and Foster hit the Malaysians with an early blitz.
They picked up an astonishing 14 shots in the first seven ends to leave opposing pair Fairul Izwan Abd Muin and Muhammad Hizlee Abdul Rais looking badly out of their depth.
The shell-shocked duo did manage to draw the eighth end but the haemorrhaging of points continued as the Scots romped 19-0 ahead - just two shots shy of an automatic win.
Malayasia ensured they did not suffer total humiliation as they picked up three shots over the 13th and 14th ends.
But Marshall then wrapped up a near-flawless victory in the 15th exchange with a single before the Malaysians finally admitted the game was up and conceded.
The win also takes Scotland to 12 golds - a new Games record.
The triumph is Marshall's third Commonwealth title after pairs victories in 2002 and 2006 but he said winning in front of a home crowd was his biggest achievement to date.
He said: "This is just fantastic. I have won two golds before but this one tops the lot. Playing in your own back yard, in front of your own fans - you just can't beat it. Simply the best.
"It's definitely one of the highlights of my career. That is our 12th gold medal of the games for Team Scotland, so that is another record broken, which is fantastic.
"We got off to a good start. Paul was phenomenal from start to finish and that makes my job a lot easier.
"But even so, there was still a lot of pressure on us. We just had to keep going and that's what we did."
Foster, who won a Commonwealth pairs gold in Melbourne eight years ago, feared his chances of landing a second had been ruined just a fortnight before the game when his prize bowls were stolen.
However, they were soon returned to the Troon taxi driver and he lapped up his latest triumph, saying: "I didn't think anything would beat 2006 but this tops everything. To win a gold on home soil is a feeling that will live with me forever."
Meanwhile, England claimed bronze in the pairs contest as Andrew Knapper and Sam Tolchard beat Namibia's Douw Calitz and Wilem Erasmus Esterhuizen 19-12.
Earlier in the day, Northern Ireland had seen hopes of a first gold medal at Glasgow 2014 crushed when Neil Booth's triples team fell to South Africa.
Booth and partners Paul Daly and Neil Mullholland went down to a 19-10 defeat as Bobby Donnelly, Prince Nelounde and Petrus Breitenbach collected the Rainbow Nation's sixth gold.
The skip admitted the silver medal was little consolation: "This is absolutely not what we came here for.
"We came here to try and win the gold. You will take any medal you can get at the start of the event but I fancied our chances.
"I'm just disappointed with the performance as much as anything. We got off to a terrible start and went 14-3 down.
"It is always difficult trying to come back from such a big deficit because you are always going to lose an end somewhere along the line."
In the bronze-medal match, the Welsh trio of Marc Wyatt, Jonathan Tomlinson and Paul Taylor bounced back from their semi-final defeat to the Northern Ireland to beat Australia's Matt Flapper, Nathan Rice and Wayne Ruediger 16-13.