If it's the same as Melee, I'm pretty sure I read that spinning the control stick and pointing the C-stick in the direction you want to go is the best means of mashing out of grab and DI'ing.
Concerning DI, C-stick takes priority for DI (at least in this case; not sure if the fact that it's in a grab affects this or something...at least if I'm remembering what I read correctly).
Concerning button inputs, spinning the control stick (clockwise/counter-clockwise is negligible) quickly and pointing with the C-stick inputs one direction input and one attack input for every time the control stick hits a new direction input, which would be every notch-edge thingy around the control stick.
So for every clicky-sound you hear while spinning the control stick, you'll be inputting 2 inputs, all while still being able to DI. Pretty sure it was better explained in a really old thread with a long OP explaining the differences in the best DI/SDI inputs for Melee and Brawl, in case anyone happens to remember and can link it.
(Don't think it affects PM, but Brawl's best DI involved double-stick DI'ing, which involved inputting the two directions 45 degrees to the DI you want with the control stick and C-stick...so if you wanted to DI diagonally up-right, you'd press up on one stick and right on the other; the chosen sticks for each direction was negligible. I think you had to hold the control stick direction and spam the C-stick direction, but I'm not sure)
If I did recall this correctly, the only downside is that if you manage to escape the grab, you'll often end up accidentally using your double jump immediately (since you're spinning the control stick). You can avoid this by getting used to the timings you can break out of grabs relative to your %s (if you're having trouble getting the hang of this, counting the max number of pummels can be helpful), and/or reacting to the breakout animation and stopping spinning.