In the case of the night prayer, is it permissible to include 40 individuals whose names I do not know, and what is the best way to ask for forgiveness on their behalf?
Praying for forty believers during the Qunoot of Witr which is the last and single Rak'at in Night Prayer, is recommended but not obligatory. You can include any one whom you want even if you don't know their names as far as you remember them e,g, my teachers, my class mates, those who did good to me etc. You pray for their forgiveness ALLAHUMMA EGHFIR (O Allah, forgive).
Wassalam.