Assuming you are speaking about source circuit conductors, there would be numerous encumbrances to use of NM "romex:"
First, the location is almost certainly going to be damp or wet. Not allowed to use NM in this location. 334.12(B).
Second, there will likely be be numerous questions about exposure to physical damage, mitigation of which could make NM cable not worth the cost.
Third, you would likely have to transition to another wiring method via a junction box or something, to connect to the modules (can't just strip the romex and leave it in the air.
PV Wire (which usually us a USE-2/RHW wire with a 2000V rating and marked as PV wire) is readily available nowadays.
Regarding the comments on the need to guard conductors or enclose in a raceway per 690.31, this requirement could apply, regardless of if one is using NM cable, or PV Wire. This would be a conversation to have with the inspector in many cases, as to is the wires are considered readily accessible. here are some examples of interpretations of 690.31:
- An unfenced ground mounted solar array in someone's yard would have conductors that are readily accessible, and would need either guarding or raceway.
- A PV install on a rooftop would require the use of ladders, and would therefore not be readily accessible.
- A commercial PV installation with a fence meeting the requirement of 110.31 would meet the requirement for being "guarded" and the conductors inside would not have to be enclosed in a raceway simply due to their being readily accessible.