Are you sure that the line spacing in tables must be identical? I think the table is generally a very special case, so sometimes to fit everything inside you would have to decrease font size, or line spacing.
I never had to change the text boundaries in actual documents, nor have I saw someone use it, not that I ask everyone do they use it or not.
For raw element, you are expected to use a monospaced font. And if the lines are too long, then sometimes you are forced to decrease its font size.
show raw: set text(10pt, font: "Fira Code")