... i'm not sure if there's a limit to how many sides the collision polygon can have
Too many sides (say, > 8) put too heavy a burden on the engine (each point on each polygon has to be compared, and coming from JavaScript, that's a pretty processor-intensive process).
The bottom line: limit the number of sides to the minimum that give you the results you need.