This is a difficult one. On the face of it, your girlfriend would be entitled to apply for Discretionary Leave to Remain based on the fact that she is the parent of a UK National child.
In a judgment passed last year, Zambrano v ONEm Case C-34/0 the European Court of Justice seems to have held that the parents of a child who is a national of a Member State must be granted the right to work and the right of residence in that Member State in order to protect the right of the child to live in Europe.
The facts were that a Colombian couple claimed asylum in Belgium and were refused but never removed. They had two children in Belgium, both of whom were Belgian citizens. The father worked for a time but this was illegal work and after a raid on his employer he was sacked. He attempted and failed to claim unemployment benefits.
The questions for the Court were whether this factual situation gave rise to a right to work and/or a right to reside for the parents in order to protect the rights of the children. The Court has answered these questions in the affirmative, it seems. At paragraph 45 the ECJ concludes as follows:
"...Article 20 TFEU is to be interpreted as meaning that it precludes a Member State from refusing a third country national upon whom his minor children, who are European Union citizens, are dependent, a right of residence in the Member State of residence and nationality of those children, and from refusing to grant a work permit to that third country national, in so far as such decisions deprive those children of the genuine enjoyment of the substance of the rights attaching to the status of European Union citizen."
Despite the reference in this paragraph to European Union citizens, the facts of the case were that the children were Belgian and lived in Belgium: there was no question of direct interference with free movement rights to move between other EU countries. In another landmark case, Chen, the child was living in the UK but was an Irish national and had independent means of support not involving the parent working in the UK. Zambrano extends the principle to, for example, a British child living in Britain and with no independent means of support.
Thus, in your case, I would be of the opinion that your girlfriend would be able to apply on this basis. The problem that I see is that the child is not yet born and is not due until August.
As this is the case, it may be worth your Girlfriend extending her Student Visa and then applying for Discretionary Leave once the child has been born.
The alternative is that she becomes an overstayer and then applies when the child is born, although this is NOT advised.
I hope this answers your question. If so, kindly click accept.
If you wish to discuss, please feel free to ask further questions.