Gut probs are fairly common on the spectrum. Some children benefit from dietary changes alone, while others also require medical treatment for dysbiosis -- fungal/bacterial/parasitic infections.
GF/CF diet is the most common initial recommendation for dietary change, but there are kids who responds better to the SCD diet, or diets based on allergy testing.
My own son had
resolution of major gut issues with the GF dietary change. He had constipation so severe that we regularly had to remove the toilet deal with blocked plumbing. Also a lot of very stinky gas. This disappeared with GF diet, but does recur with dietary infractions.
The GF portion of the diet is very exacting. No one is ready or prepared to do this -- it's not like a weight-loss diet where you can occasionally cheat & still see positive results. This is because gluten has effects on the gut, brain, & immune system that can last for about 6 weeks. Often people do not see positive results from the diet for many months. In part, that's because of residual gluten as well as the getting-up-to-speed aspect of the diet. It's common for parents to unwittingly make mistakes at first, but after a while the diet becomes second nature like anything else.
Basically a GF diet is avoidance of all gluten-bearing grains (wheat, barley, rye, oats, & their derivatives). This is not as easy as it seems, because of the many derivatives & their presence in virtually all of the modern prepared foods we've become dependent on as a culture. So for starters, bread, cookies, cake, pastries, pasta, breakfast cereals, most snack foods have to be replaced with GF alternatives. Almost anything you find in a box or a can at a grocery store is suspect. Produce-aisle plain veg & fruit, nuts from the shell, plain raw meat without seasoning & additives (you cook it of course) are all OK. So for starters, shopping the fringes of the grocery store for whole foods is a good idea.
Gluten can be present in beverages, spice blends, art supplies incl play dough, home-repair materials, glues, cosmetics, shampoos, hand lotions ... the list goes on & on.
Dana Korn has written many books about living gluten free
-- check your public library. The most recent one was
Gluten-free Living for Dummies. (not that you are

)
Many kids do well with both GF & CF. My son has done three lengthy trials of CF with no change, however he is the exception. You do see this occasionally. You also run into kids who need soy free, or nut free, or egg or corn or whatever.
The CF portion of the diet is IMO a little easier because current labelling laws require dairy to be labelled. Shopping is easier than for the GF portion, because only wheat is required to be labelled, not gluten. However casein can show up in weird places like canned foods, sausages, 'dairy substitutes', boxed meals, etc.
A great recipe resource for GF/CF diet for kids on the spectrum is
Special Diets for Special Kids, by Lisa Lewis, in 2 Volumes. These are spendy books, but my library got them for me to borrow through interlibrary loan ( ask at reference desk). The recipes are kid-tested, replacements for regular kid food.
Other considerations with GF/CF diet: will the whole family follow the diet? Time & monetary considerations. Cheating opportunities if conventional foods remain in the home. Sensory issues. Follow-through at school. Difficulty eating out.
But IMO it is defintely worth a try, esp. if there are gut issues.
Best wishes.