Pad strings to a target width
Pads strings on the left, right, or both sides until they reach a requested width. Width is measured in characters (Unicode code points), so multi-byte UTF-8 strings are padded correctly and never split.