The OP's question reduces to the the specific structure of the clause:
πάντες ἐμαρτύρουν αὐτῷ = all were bearing witness/testifying to/for/about him.
- The verb ἐμαρτύρουν (were bearing witness/testifying) is imperfect indicative active, 3rd person plural
- πάντες (all/everyone) is nominative masculine plural and is the subject of the above verb
- αὐτῷ (to/for him) is dative masculine and thus forms the object of the verb.
Thus, I would translate this clause as (given the context):
all were testifying about him ...
The meaning is unambiguous: the people were saying/testifying things either to/for/about Jesus. The rest of the verse enumerates the things they were saying:
- marveling at the words that proceeded from Jesus' mouth,
- Is this not the son of Joseph?
Benson sums this well -
Luke 4:22. And all the congregation bare him witness, and wondered at
the gracious words, &c. — By this it appears, that our Lord proved and
illustrated his assertion, (that the passage he had read was that day
fulfilled,) in a discourse of considerable length, the subject of
which only is mentioned by Luke. And it seems also, that on this
occasion he delivered his thoughts with such strength of reason,
clearness of method, and, perhaps also, beauty of expression, that his
townsmen, who all knew he had not had the advantage of a liberal
education, were so astonished, that in their conversation one with
another they could not forbear expressing their admiration. At the
same time, however, their carnal and worldly spirit, not to say the
malevolence also of their disposition, led them to mingle with their
praises a reflection, which they thought sufficiently confuted his
pretensions of being the Messiah, and showed the absurdity of the
application which he had made of Isaiah’s prophecy to himself, in that
character; And they said, Is not this Joseph’s son? &c.
Barnes is similar:
All bare him witness - All were witnesses of the power and truth of what he said. Their reason and conscience approved of it, and they
were constrained to admit the force and propriety of it, and on this
account they wondered.
Thus, of the OP's options, I would select the second as closest to the meaning of the Greek.