I'd say it highly depends on what you'd like to achieve with o_badge_Foo and what you want to cover.
Some options are:
Using decoration-ALERTTYPE attributes (works nicely when common bootstrap alert types are applicable):
<field name="data_provider_type"
widget="badge"
decoration-info="data_provider_type == 'a'"
decoration-warning="data_provider_type == 'b'"
decoration-danger="data_provider_type == 'c'"
decoration-success="data_provider_type == 'd'"/>
Using simple invisible attributes (works nicely, when there is a limited number of different classes to be applied):
<field name="data_provider_type" widget="badge" class="abc" invisible="data_provider_type != 'a'"/>
<field name="data_provider_type" widget="badge" class="xyz" invisible="data_provider_type != 'b'"/>
Using a custom widget:
See https://www.odoo.com/documentation/18.0/developer/howtos/javascript_field.html
(or any other core widget: https://www.odoo.com/documentation/18.0/applications/studio/fields.html)
Also, you maybe could use a different field type to begin with - i.e. a Many2many. This would allow you to utilize the many2many_tags widget that is rendered similarly to a badge, but allows for and additional options attribute to define what field to fetch the color for that particular tag from:
<field name="data_provider_type_ids" widget="many2many_tags" options="{'color_field': 'color'}"/>