Activating 2 or more bone layers at the same time with one button
Operator property



Here is a "dodgy" little operator that instead of passing a list of booleans, eg bone.layers = [True] * 32 (which would set all bone layers to True), uses a comma separated string of layer numbers, as the indices to toggle.

Test script for bone layers based on active pose bone.

import bpy
from bpy.props import StringProperty

class SimpleOperator(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.simple_operator"
    bl_label = "Simple Object Operator"
    layers : StringProperty()

    @classmethod
    def poll(cls, context):
        return context.active_object is not None

    def execute(self, context):
        pb = context.active_pose_bone
        bone = pb.bone
        layers = [int(l) for l in self.layers.split(",")]
        for l in layers:
            bone.layers[l] = not bone.layers[l]


        return {'FINISHED'}


def register():
    bpy.utils.register_class(SimpleOperator)


def unregister():
    bpy.utils.unregister_class(SimpleOperator)


Obviously change the class names etc to better suit (from simple operator template)

Now in the layout can

layout = self.layout
op = self.layout.operator("object.simple_operator", text="18, 19")
op.layers = "18, 19"


to toggle layers 18 and 19.

Notes

Cannot turn off all layers, at least one has to be True.

Could extend above to include select, deselect as well as toggle (which it does now)