Upvote:3
Entering as a visitor with the intention of getting married in the UK is not permitted under the Immigration Rules. https://www.gov.uk/standard-visitor-visa
Foreign nationals who do not have a marriage visitor visa or family visa can still give notice of intention to get married or form a civil partnership but the immigration authorities at the Home Office will be told.
The Home Office might:
ask questions about you and your relationship - if this happens you may need to wait up to 70 days before getting married or forming a civil partnership
decide not to approve your notice - if this happens you cannot get married or form a civil partnership in the UK
Source: https://www.gov.uk/marriages-civil-partnerships
Note: this answer assumes your girlfriend would not be moving to live permanently in the UK after your marriage.