There is a Robert Marshall who is married on January 1, 1816 in Bathgate to a spouse "name not given".
Are you sure that the actual marriage was on 1 January? Because in some cases the parish register just gives you the year, not the actual date, and on some sites that have only transcriptions such dates default to 1 January. You have to view the original to see what it actually says.
my understanding is that the church baptized all children without requiring the parents to formally marry
Yes, that is right. But generally the Kirk Session would pursue the parents of illegitimate children, partly in order to punish them for the sin of fornication, and partly to make sure that the father contributed to the upkeep of the child so that the child did not become a burden on the parish funds. The minutes of the Kirk Session are always worth checking because, if they have survived, the records of the case often contain quite a lot of information about the errant parents. In the case of Peter, you'd need to check both Bathgate and Slamannan, for reasons stated below. The KS minutes are mostly in the National Records of Scotland, and have been digitised, but they're not available online, so you'd need either to go to Register House in Edinburgh, or to one of the other archives that has a link to the NRS, or get someone to do so on your behalf.
Why not list the spouse?
Careless record-keeping, pur and simple. That, combined with the aupposed 1 January date, suggests that this marriage was stuck in as an afterthought by the parish clerk, who had heard that Robert Marshall had got married but didn't know whom he had married. Perhaps Robert Marshall's wedding was held outside the parish, or it was an irregular marriage, or celebrated in some denomination other than the Church of Scotland.
The IGI lists eight children of Robert Marshall and Jean Arthur, all but Peter born in Slamannan, between 1812 and 1827. These are from the 'community indexed' section so ought to be reliable. You need to look at all those baptisms see what they tell you.
FreeCEN has a Marshall family in the 1841 census at Bridgend, Slamannan matching the children of Robert M and Jean Arthur: Robert, 58, shoemaker; Jane, 54; Marion, 29; John, 22; Janet, 19: Mary, 17, all born Stirlingshire. Plus three other people, different surnames.
They're still there, at Avonbridge, Slamannan, in 1851: Robert, farmer, 68; wife Jean Aurthur, 65, birthplace unknown: Marion, 39, blind; John, 29; Janet, 26; Margaret, 22; gransdon Peter Millar, 11, born Carluke; and a servant. All born Stirlingshire except Jean and Peter.
A Robert Marshall, aged 74, died in Slamannan in 1858.
Of course it could be coincidence - another couple with the same names having family in the neighbouring county at the same time. Note that a Robert Marshall and Jean Arthur were married in Slamannan in 1810, and that not only was the marriage of a Robert Marshall to an unknown wife recorded in Bathgate in 1816, there was a similar record in 1814.
You can see the originals of all those marriages and baptisms, the census and Robert's death certificate at
www.scotlandspeople.gov.uk. Of course it could be coincidence - another couple with the same names having family in the neighbouring county at the same time, but you need to check even if only to eliminate them.