At one time the NEC specified pool pumps shall be on a dedicated circuit. Within the last few NEC revisions the requirement for a dedicated circuit was dropped.
It would make sense that the wire size can be based on motor amps is the motor is on a dedicated circuit. However if other loads are put on the same circuit then the circuit can overload the wire size and not the CB.
The requirement for a pool pump motor on a dedicated circuit conflicted with the practice of powering the SWG on the same circuit as the pump. And sometimes the gas heater is put on the pump circuit.
So how does the NEC keep a motor circuit from overloading the wire size if it is not on a dedicated circuit?
Section 680.21 (a)(1) states at a minimum all wires feeding a pump will be insulated and not smaller than 12gauge.
In addition 680.22 (a)(1) requires the addition of separately wired 15 or 20 general purpose outlet.
Outside of those requirements you need to follow the other code sections as they apply to wire size a breaker protection.
Where the pump isn't on a dedicated circuit you need to size the protection and wire for the mixed use.
An important thing to note about the particular pump mentioned in this post is that it is a VS pump. This pump has virtually zero inrush current because it's a soft start motor. Motor inrush is not causing the GFCI breaker to trip in this case because it's not there.
Motor inrush is also the reason dedicated pump circuits get larger breakers than you would otherwise use for the wire often up 150% standard ratings. Those types of motor circuits typically also are equipped with time delay fuses sized for the wire or expected full running amps. Or the motor control is equipped with thermal overloads. None of these types of circuits are common in residential settings. The exception being large HVAc equipment.
Speed changes on VS pumps do case line imbalances and harmonic feedback when changing speeds. Weak or overly sensitive GFCI devices will false trip under these conditions.