For freelancers and small consulting shops the general advise is to do consulting in a different field than their own product/startup. That's because a freelancer can't dictates the contract terms to the customer, which is usually a larger company, and also the legal expenses would be too large relative to the contract size.
You should incorporate a new company anyways for lots of other reasons.
Large consulting shops may have a better protection since they can afford lawyers and can negotiate better contracts.
Employees usually protected much better than freelancers/consultants, b/c they don't have much negotiating power over the small letters of the contract. So many NDA/non-competes might be non-enforceable in practice.