If this is the case, doesn't this logic essentially adhere to the
'security through obscurity' mentality that is generally frowned upon?
Security through obscurity is only frowned upon when used instead of a more fundamentally effective control. Typically it is best to apply multiple layers of security, and it is perfectly acceptable and beneficial to use obscurity as one of those layers.
For example it's fine to name the text file storing your encryption keys something obscure in the hope that if someone compromises your system they won't be able to find it, but don't put that text file in a publicly accessible place just because it's named something obscure.
Using your scenario, it's fine to derive security benefits from running a less common platform - but don't forgo other controls such as a firewall and general security concious behaviour just because you're running Ubuntu.
What other security advantages are there to switch to Ubuntu, or
another Linux distribution more generally?
There is nothing that makes Linux fundamentally more secure. Some controls may be implemented or applied differently, but there is nothing that makes Windows outright less secure. Plenty of people can and do run highly secure systems on Windows.
It's possible that on average fewer security issues occur on Linux, but if that's the case then it's probably due to a combination of secondary factors such as:
- Linux users in general are likely to be more security concious, not click on popups, open dodgy attachments, etc.
- Linux users are less likely to operate in a privileged environment (eg. by default not running as root vs. a lot of people who turn off UAC on Windows)
- Arguably it's easier to update vulnerable software using a package manager on Linux
On the other hand, there's several factors which cause me to believe OS choice isn't that significant in terms of security overall:
- It's not that common that OS vulnerabilities are primarily responsible for an intrusion. More often the malware gets in via a vulnerability in some other application or by user error, which then might exploit the OS once in.
- Arguably Linux users are more valuable targets on average because they're more likely to have access to other systems, servers and production code.
- Linux has the majority in the web server market, and there's plenty of both successful and unsuccessful attacks, malware, and vulnerabilities for Linux in this domain