Is this indeed so, is there a Jewish law forbidding cutting a toddler's hair, or is this a merely an Ashkenazi custom?
There is no such a law! Halacha allows one to cut baby's hair on Chol HaMoed, for example.
See Shulchan Aruch in 531: 6 - סימן תקלא - דיני גלוח בחל המועד, for example.
ו: קָטָן מֻתָּר לְגַלֵּחַ בַּמּוֹעֵד, אֲפִלּוּ נוֹלַד קֹדֶם הָרֶגֶל; וַאֲפִלּוּ בְּפַרְהֶסְיָא שָׁרֵי (וְכֵן מַשְׁמָע מִמָּרְדְּכַי).
It's not an Ashkenazi custom either; it's more of a Chasidishe custom that has recently been universally adopted, by some people. (Oxymoron intended.)
Where does this tradition come from? I can hardly imagine a commandment that would apply to toddlers but not older kids or adults.
See the answers to the question What is the source for the “Upsheirin”? for various answers ranging from Kabbalistic to pagan.
How do usually parents who don't cut the boy's hair prevent it from getting in front of his eyes.
As sabbahillel commented, use regular hairdressing techniques like pins, clips and even trimming when needed, when nobody is looking ;-)
Or you could get him a Kippa and fold the fringe under it, attaching the Kippa with hair clips; that's how Prince Charles does it!
Or this cute kid: