2.90 "keyword "apply_as" unrecognized" - Error
This is not specific to boolean modifier. There was changes to python for modifiers. Remove the apply_as='DATA' and it should work.
Before we did
for data
bpy.ops.object.modifier_apply(apply_as='DATA')

for shapekey
bpy.ops.object.modifier_apply(apply_as='SHAPE')

Now we do
for data
bpy.ops.object.modifier_apply()

for apply shapekey
bpy.ops.object.modifier_apply_as_shapekey(keep_modifier=False)

for save shapekey
bpy.ops.object.modifier_apply_as_shapekey(keep_modifier=True)

To use multiple versions of Blender, you can do like this.
version = bpy.app.version

if version &gt;= (2, 91, 0):
    bpy.ops.object.modifier_apply()    
else;    
    bpy.ops.object.modifier_apply(apply_as='DATA')