There are several makers of switch and junction boxes using PVC or other resins acceptable to code. The code requires the romex to be restrained by a staple or ? Within a few inches of the box. OK so far?
Some brands are obvious how to get the romex into the box as they have a simple rectangular...