Got it to work
data.lua
local poleLamp = data.raw["lamp"]["small-lamp"]
---@type table<string, boolean>
local excluded = {}
for name in string.gmatch(settings.startup["polelamps_expluded"].value, '([^ ]+)') do
    excluded[name] = true
end
for _, pole in pairs(data.raw["electric-pole"]) do
    if not excluded[pole.name] then
        pole.light = table.deepcopy(poleLamp.light)
        pole.light.minimum_darkness = 0.5
    end
end
settings.lua
data:extend({
  {
    type = "string-setting",
    name = "polelamps_expluded",
    order = "aa",
    setting_type = "startup",
    default_value = "bi-power-to-rail-pole bi-rail-hidden-power-pole ee-super-electric-pole ee-super-substation",
  },
})