Had another think about it when I woke up and realised two things. One, you're situationally using "Worker" and "Workers" which I didn't account for and Two, I don't think I actually technically "Improved efficiency", just reuse/readability.
To account for both of these points, you could do something utterly disgusting like this:
var worker_num = 6
func _on_Button_pressed():
var input_number = get_node("../LineEdit").text.to_int() #assuming your not reusing you can chain .to_int()
var pieces_per_person = input_number / worker_num
var remainder = input_number % worker_num
# following bit looked to be the same under all conditions
var base_txt = str("PIECES ", input_number) + "\n" + str("PIECES PER PERSON ", pieces_per_person) + "\n" + str("REMAINDER ", remainder) + "\n"
get_node("../Label").set_text(base_txt + str(remainder, " Workers ", pieces_per_person + 1, "\n").replace(str("0 Workers ", pieces_per_person + 1, "\n"), "").replace("1 Workers ", "1 Worker ") + str(str(worker_num - remainder).replace(str(worker_num), "All ") + " Workers " + str(pieces_per_person)).replace("1 Workers ", "1 Worker "))
This I suspect at some level might be faster (depends on how GDScript works under the hood so it could even be slower lol, ymmv) as it avoids branching entirely through use of string replacement, but this is where I would argue readability is absolutely more important than performance, so please don't do this. Also, I suspect this could be done with less replaces, but meh, chaining like this is foul to begin with and should be avoided unless you WANT your colleagues to hate you lol.
Ultimately the original IF statement would likely occur in sub ms times so not sure why you need more performance for something that should not affect frame times. If you were running this every frame it might be worth interrogating, but ultimately string manipulation in an IF statement should in most cases be negligible.