How can I delete keyframes and animation data for all selected objects?
One fell swoop approach.
copying the script from Delete animation of object
Uses Object.animation_data_clear() to remove all animation data from all selected objects.
import bpy

context = bpy.context
for ob in context.selected_objects:
    ob.animation_data_clear()

this will orphan any action not associated with other objects, and they will be dealt with on file save / reload.
Otherwise
orphans = [a for a in bpy.data.actions if not a.users]
while orphans:
    bpy.data.actions.remove(orphans.pop())