Non-EU student B permit extension

I have a young friend who is studying at a Swiss university.

She has lived in Switzerland for the past three years and has just obtained her BsC.

The graduation ceremony takes place on the 15th September 2023.

Her B permit expires at the end of September.

She is enrolled to study for her Masters at the same Swiss university, starting in February 2024.

She will return to her home country in Central America from October 2023 to January 2024.

She is planning to keep her student accommodation from now until she finishes her Masters, and she'll continue paying her health insurance in Switzerland.

She is unsure whether she can simply ask for an extension to her B permit, given that she'll leave the country for approximately-three to three-and-a-half months.

I've searched around EF but can't seem to find an answer to her particular issue.

We'd both be very grateful for any pointers.

I'm not sure for Switzerland but I think that in general you can't leave the country for more than 3 month being on a student visa/permit

This is one case where a letter written by a university professor explaining the situation to cantonal authorities can help a lot.