I don't do medicine, but I did do a degree with a year abroad, which in my case was very splintered due to covid, so I was back-and-forth.
I did just rent airbnbs for short times and then found a student accommodation place that gave me a 2 month contract for the summer.
For me, it was definitely better than renting somewhere permanent that would have stayed empty most of the time. While it was a little inconvenient to basically just be living out of two suitcases, the money saved was worth it for me.