There is a tutorial video on how to get all 40 stars. To move as fast as possible, you have to master the input timing, not just the solution. There is a slight delay after ever move with no input buffering to prevent button mashing.
Setting a time requirement and then artificially limiting how quickly a person can move so each input has to be frame-perfect is just infuriating and unfair. Tutorial doesn't help if you can't physically move fast enough without using a script.