I couldnt find a relevant test in the python binding, so instead I whipped up this example:
import alembic
arch = alembic.Abc.OArchive('/tmp/vislayer.abc')
# lets sparsely set visibility on /foo/bar/baz
fooObj = alembic.Abc.OObject(arch.getTop(), 'foo')
barObj = alembic.Abc.OObject(fooObj, 'bar')
bazObj = alembic.Abc.OObject(barObj, 'baz')
# assuming 24 fps, have a sample for every frame that starts at frame 101
ts = alembic.AbcCoreAbstract.TimeSampling(1.0/24.0, 101.0/24.0)
visProp = alembic.AbcGeom.CreateVisibilityProperty(bazObj, ts)
# -1 means deferred visibility, which is implicitly visible unless an ancestor marks it as invisible.
# 0 means invisible
visProp.setValue(-1) # frame 101
visProp.setValue(0) # frame 102
visProp.setValue(0) # frame 103
visProp.setValue(-1) # frame 104
visProp.setValue(0) # frame 105