score:2
Speaking as someone who lived in England as a student for many years, it's perfectly fine for you to write the invitation letter to your girlfriend yourself. You don't need to be a British citizen or a house owner to invite someone to come and visit you. I wrote multiple letters inviting my parents to visit me in the UK, and we never had problems with that.
I'd suggest you base your letter on templates from UK universities, as they are used to helping foreign students. For example, this one from the University of Essex, or this one from the University of Salford, or this one from the University of Greenwich. You'll also get a pretty good idea of what kind of information is typically included in such letters.
I'd also suggest against having your friend or his mom writing the invitation letter. This is because the border agent could question your girlfriend on her relationship to them (i.e. "For how long have you known this person? What is your relationship to them?") and this could lead to problems. If you prefer, you might add in your letter that the house owner is aware of and has authorized her visit, but I personally don't think this is necessary.
Hope this helps!