Apply modifiers in all objects at once
Nearly this answer.
For all modifiers you can run this script that will apply them all:
import bpy

for ob in bpy.context.selected_objects:
    bpy.context.view_layer.objects.active = ob
    for name in [m.name for m in ob.modifiers]:
        bpy.ops.object.modifier_apply( modifier = name )

To run the script:
open a text editor, create a new text, paste the code above, select the wanted objects, and use the button indicated in the picture below:

If you want to apply modifier that are visible in viewport only, use this:
import bpy

for ob in bpy.context.selected_objects:
    bpy.context.view_layer.objects.active = ob
    for name in [m.name for m in ob.modifiers]:
        modifier = ob.modifiers[name]
        if modifier.show_viewport:
            bpy.ops.object.modifier_apply( modifier = name )