The commerce clause doesn't override the second amendment (or any other part of the bill of rights), there are only cases where a particular amendment was found not to apply.
What you're looking for is emergency powers, but they're not actually in the constitution. In practice what has happened is that Presidents do whatever thing in an emergency and then get sued over it after, and typically lose, but by then it's years later and whatever temporary measures they ordered in the middle of the emergency are long since discontinued.
It's kind of a kludge, but it also kind of works, because it keeps the emergency measures from extending longer than it takes for the courts to catch up to it, and also gives the victims of rights violations the ability to get compensated after the fact for being done wrong in the midst of a big mess.
There are also strong restrictions on the scope of quarantine orders that would be allowed to circumvent due process in emergencies.
"If a quarantinable disease is suspected or identified, CDC may issue a federal isolation or quarantine order.
Public health authorities at the federal, state, local, and tribal levels may sometimes seek help from police or other law enforcement officers to enforce a public health order.
U.S. Customs and Border Protection and U.S. Coast Guard officers are authorized to help enforce federal quarantine orders.
Breaking a federal quarantine order is punishable by fines and imprisonment."
https://www.cdc.gov/quarantine/aboutlawsregulationsquarantin...