How to scale without adding line breaks?

First of all, you can format your code using a code block like this:

``​`typ
your code
``​`

Regarding your problem, you can wrap the scale in a box to make it inline:

Hello #box(scale(300%, reflow: true)[World])!

Hello #text(size: 3em)[World]!
2 Likes