If Bernie Sanders does not get the Democratic nomination (as is quite possible, given the Super Tuesday results), could he still switch gears and run for office as an independent candidate? Or is there something that forbids him for running as an independent?
Yes he could.
Anyone can get on the ballots as long as they have enough signatures; their participation in a private event like a party primary is irrelevant), as long as that candidate manages to get on the state ballots in time.
The concept of 3rd party run by a loser isn't new - it was raised previously in 2016 election when a possibility of Trump doing so was discussed among Republican party.
According to this article discussing Bloomberg's possible run as an independent in International Business Times:
But time is running out. Logistically, he has to get the required amount of signatures — anywhere from 1,000 to 89,000 — in each of the 50 states before each state's cutoff date
The exact deadlines vary state by state but from what I was able to discern, most are around 2 months; meaning you need to submit enough signatures to each state by start of September.
The requirement is called "Ballot Access" and is discussed in detail on Wikipedia, including legal basis explaining the "Yes" answer on top; and state by state notes.
 - There seem to be less stringent (if any) requirements for being a write-in candidate, but that's getting too much into the weeds