Time is working a bit in your favor.
The fixed interest period of the KfW loan ends by 2021 at the latest, and the 15-year loan has a special termination right after 10 years and 6 months without a prepayment penalty, right?
My plan would be to look for a forward loan over 36 months (just for you) for the entire remaining debt +25k to be paid out. Once you have found a bank, you make a notarized purchase contract with your girlfriend and the payment is made in 2021. That would be the "simple" part.
Then you just have to convince your ex to sit out the 3 years and sweeten the waiting time for her, e.g. with interest on the 25k. Either in advance, ongoing, or retroactively.
And if the installment loans are still running then, repay them immediately with the new loan as well.