Regarding using Carfax to look for non-reporting of an accident
Do insurance companies take those records (e.g. CARFAX) into account
when pricing policies even if no claim was filed?
The presence of the Carfax report doesn't tell the insurance company that you were responsible for an accident and are hiding it from them.
In February 2021 during a snowstorm a tow truck turning onto my street lost control, over corrected, and slammed into my car. It was 100% not my fault. My insurance company was never told. The tow company went though their insurance policy to cover everything: repair, tow, and rental car.
At first the tow company wanted to tow my car, to a repair shop next door. They promised to pay for everything. I insisted that we go though their insurance company.
Does it ever make sense to not file a legitimate claim after a car
accident to avoid a hike in rates or cancellation of the policy?
The only way you could get away with this is a single car accident, with nothing else damaged, and the police not writing a ticket. Otherwise the other party will be submitting a claim, and the record of the ticket on your driving record should eventually be noticed.
Now if there was a small amount of damage, that was either under the deductible, or barely over the deductible, and nobody else involved, you could decide to not make a claim. People make this same decision when making a claim against their homeowners policy to avoid being cancelled for too many claims.