I’ve seen parishes ask for 9 or 12 months notice, too.
The 6 months notice requirement is not something that is specified in Canon Law. This doesn’t mean, of course, that it’s not the rule to go by in most places. Dioceses and parishes can make rules in this regard, and most do in order to allow for the adequate formation of the couple (not to mention the logistics of calendar planning).
Can these rules be set aside in certain circumstance? I have seen it happen. Mostly, it’s for couples whom the pastor already knows has a firm grasp of what marriage actually is.
If the case you have outlined, I cannot think of a priest in real life who would make an exception for such a couple. Generally, if a couple conceived a child when they weren’t married, the priest would take that as a sign that they definitely need as much marriage preparation and formation as they can get (since it would be an indication that they don’t fully understand and appreciate the Catholic teaching that sex is reserved for marriage).
In fact, many priests would even counsel the couple to wait until after the baby is born before even beginning marriage preparation simply because of the risk that rushing into marriage due to a pregnancy could potentially impede the couple’s ability to freely consent (as the baby might make them think they “have to” get married).
I have still seen “shotgun weddings”, though, even more recently. The one I recall, though, was for a couple who really were committed Catholics, already planned to get married, but simply let things go too far. The difference for them was they both recognized that what they did was wrong. So the priest did not make them wait to get married until after the baby was born. Now, if the couple had been living together and/or did not understand or agree that it was wrong to have sex outside of marriage, then I imagine it would have been handled differently.
Of course, it’s your story, so you can play fast and loose with the details. But you probably wouldn’t be here asking questions if that’s what you wanted to do.