Take the exam.
My son started at a college that didn’t give him AP credit – but he ran into some academic problems, quit school for awhile, and later transferred to an in-state public. When he transferred – the AP credit came in very handy – it helped eliminate some general Ed requirements and gave him enough credits that saved him at least a semester.
This is not something you plan for or hope for when your kid is still in high school – but a lot of kids do change majors or transfer down the line – so it makes sense to consider more than the requirements for a specific college or major.