Sorry, the documentation is wrong. Maybe they updated it to Godot 4.0 or there is a bug. Because I've definitely done it before without creating a new style. But it looks like the functions are gone and the new ones I tried don't work. This is what it shows in the docs as an example, but clearly doesn't work. Maybe for Godot 3.5 or 4.0?
# The snippet below assumes the child node MyButton has a StyleBoxFlat assigned.
# Resources are shared across instances, so we need to duplicate it
# to avoid modifying the appearance of all other buttons.
var new_stylebox_normal = $MyButton.get_stylebox("normal").duplicate()
new_stylebox_normal.border_width_top = 3
new_stylebox_normal.border_color = Color(0, 1, 0.5)
$MyButton.add_stylebox_override("normal", new_stylebox_normal)
# Remove the stylebox override.
$MyButton.add_stylebox_override("normal", null)
https://docs.godotengine.org/en/stable/classes/class_control.html#class-control-method-add-stylebox-override