FWIW those were recently completely outlawed: https://www.ftc.gov/news-events/news/press-releases/2024/04/.... In theory you can happily sign a noncompete and promptly ignore it. Unlawful contracts are unenforceable.
That does not diminish the value of unions, though.