Previously it only filtered on a specific rna path-based criteria. This commit changes it to take a predicate function instead, splitting off its previously fixed criteria into a separate function. This also renames it to `fcurves_in_action_slot_filtered()` to better reflect its new generalized functionality. No functional changes intended. Pull Request: https://projects.blender.org/blender/blender/pulls/128423