And of course it is possible for any company to make short-sighted decisions that result in bankruptcy. Hiring too many people and being obligated to pay them is just one of several; if we're worried about companies going bankrupt and that being bad for ... employees? investors? society? ... then we should prevent them from making all kinds of bad decisions, not just from having to employ people.
The solution is for employees to negotiate their employment contracts. If you want X months of notice before being terminated, demand that it's in your contract before you agree to work there. But that will mean the employer will want to offer less compensation, because they're incurring a cost and it's always a quid pro quo. Putting the rules in the law instead of the contract only prevents you from choosing the other thing -- lots of people would rather get paid more than have more notice when being laid off.
Sounds like a great way to incentivise companies to discriminate against old people and people with preexisting conditions.
On the other hand, the downsides of at-will employment are basically solved by having unemployment insurance.
> So have it kick in once you hire N employees or make more than $M in revenue.
The trouble with this is well demonstrated by the instant case -- Tesla has lots of employees and revenue but also major operating costs. It's more likely that a large company can absorb x% in overhead than a small one, but that doesn't mean it's always the case. And it doesn't help anybody for 100% of the employees to lose their jobs instead of 7%.