Burn ASS subtitle onto MKV without any quality loss

I want to burn embedded ASS subtitle onto MKV, but I'm completely clueless when it comes to video converting. I want to keep the same quality, file size and everything else but the subtitle hardcoded.

Can you recommend me any programs/settings to achieve this? I heard that Handbrake can do this but I have no idea what settings to use. Thank you.

The only way to do it with literally zero mathematical quality loss is to make a gigantic output file with a lossless codec. (e.g. utvideo, FFV1, or x264 in lossless mode (--qp 0).
Anyway, use -c:v libx264 -preset slower -crf 20 as a starting point for your encode.