"He is me" — is this grammatical?

Solution 1:

There seem to me to be two reasonable and idiomatic native-speaker answers to the question "Who is he?"

"He" is me. [This, of course, is written English, and the bold font and quotation marks indicate that when spoken, the word he should be emphasized. It's almost the same as responding to Who's that guy in the white jacket? with "That guy's" me.]

That's me. [A native speaker probably wouldn't say "It is me" or even "It's me" but "That's me".]

Solution 2:

"It [the subject of the portrait] is me" and "He [the person who is the subject of the portrait] is me" are both correct.

Some people may favour the latter, because it's already established that the portrait is of a person (and perhaps, that it is of a male person).

Some may favour the former because in most contexts "he" and "me" would be mutually exclusive, which makes it sound a bit strange.

Sounding strange doesn't make something wrong. It's strange to be talking of the same person with the third and first person in the same clause, because contexts in which that makes sense are very rare, and in most exceptions the neuter third person ("it") are more appropriate for some other reason. This is though a case where it would make sense.

Solution 3:

It's fine, just an attempt at a tiny bit of humor. In a similar vein you may have run across statements such as "... the cavalry is us" (Mystery Men), "We have met the enemy and he is us" (Pogo), etc. It's a wry comment on the irony of the unexpected.