I am writing the answer to my question just in case when someone else is faced with a similar problem in the future and is also looking for a solution.
Guide
The Lua manual (in section 3.4.10 - Functional Calls) basically states that there are three different ways to provide arguments to a Lua function.
Arguments have the following syntax:
args ::= '(' [explist] ')' args ::= tableconstructor args ::= LiteralString
All argument expressions are evaluated before the call. Calling form f {fields} is the syntactic sugar for f ({fields}); that is, the argument list is one new table. A call to the form f'string '(or f "string" or f [[string]]) is the syntactic sugar for f (' string '); that is, the argument list is the only literal string.
Explanation
As lhf pointed out in his answer , both myfunc()"!" and myfunc(){1,2,3} valid Lua expressions. This means that the Lua compiler does nothing, given that it does not know the return value of the function at compile time.
Source sample code asked in question:
print("Hello " .. myfunc() "!")
It can then be rewritten as:
print("Hello " .. (myfunc()) ("!"))
Which (when executed) translates into:
print("Hello " .. ("everyone") ("!"))
And thus, the result is a run-time error message
attempt to call a string value (which can be rewritten as:
everyone string is not a function, so you cannot call it).
Decision
As far as I understand, these two alternative methods of providing arguments do not really benefit from the standard syntax func(arg) . This is why I ended up working on Lua parser files. The failure to save this alternative syntax was too big. Here is what I did (applies to v5.3.4):
Attention! Having done this, I changed the Lua language, as its comment says lhf, it can no longer be called pure Lua. If you do not know what exactly you want, I can not recommend this approach.
Using this small modifier, the compiler detects the two above-mentioned alternative syntaxes as errors. Of course, I can no longer use them in Lua scripts, but for my specific application this is just fine.
All I have to do is mark this change somewhere, to find it when upgrading Lua to a higher version.