Noncompetes are illegal and unenforceable in California, where Repl.it is incorporated. So if he signed a noncompete, it would actually be Repl.it that is in the wrong here, not him.
https://leginfo.legislature.ca.gov/faces/codes_displaySectio....
This does not make contracts containing such clauses "illegal", but rather unenforceable in court. The student could sign a contract saying "I will not work on a company that competes with Repl.it", and he did, and the company tried to sue him over it with that as the only claim, then the court would quickly grant a motion to dismiss the lawsuit.