I'm focusing first on the issue of the accented characters in the email body. It seems likely that the student name as it appears in the body of the email (the Name line in the "Data about the user" section) is really the same problem as that for the rest of the message body.
On my system I can create feedback emails with the accented characters you mention above and they arrive as written in the destination email account.
My impression is that something quite strange is happening with how these sorts of accented characters are handled on different systems / under different settings. It might relate to the "system" locale/encoding settings. I now suspect that the issue is a Perl issue related to the fine details of how Perl handles Unicode characters and how it internally stores strings. There is also some chance it has to do with the email transport or the like.
Are you able to send messages with other Unicode characters which are not expected in your local encoding (such as אבגד or 😀) in the text?
I suspect that the problem may be that I and others involved in adding the UTF-8 support to WeBWorK were not sufficiently expert in the complicated and confusing details about how some of Perl's "utf8" functions work, and that the decision to use "encode_utf8()" may be the culprit. That approach to "encoding" to utf8 was used in several places in the WW code (at least back then) but is apparently not robust enough for use in some places. (Now I know more about the details of Perl's Unicode support than I did back then, and am more aware of the issues which can occur.)
Based on the documentation at https://perldoc.perl.org/Encode#encode_utf8 the encode_utf8() function is not really a proper conversion to UTF-8 (and should not be used for data exchange!) as it really makes use of Perl's internal (and lax) version of utff8. The email systems are certainly expecting proper UTF-8. I suspect that in certain cases, Perl's internal character representation may leave these sort of accented characters as 8-bit characters, so they are not really being converted to UTF-8 as had been expected, while it seems that in other cases the same characters are properly converted. It seems likely that the difference may be related to what system encoding is set.
If this conjecture is in fact the root problem, then replacing
$email->body_set(encode_utf8($msg));
with
$email->body_set(encode("UTF-8", $msg));
might help overcome the problem.
Would you be willing to test this on your system (without the replacement code active)? (Since my server does manage to send mails with these accented characters, I don't see any value in trying the change on my system.)
Another possible difference is how the mail is being sent. My outgoing mail is being relayed via a local Unix system, which may handle things differently than Gmail is. If we rule out strangeness related to "encode_utf8" someone with more expertise in email matters may need to help debug this issue.