Use of joint compound for these repairs?
Remove Highs, Fill Lows

Knock down the high points with a putty knife or other similar tool so that nothing is higher than the final surface that you are after. Fill in the lows with two layers of different types of dry wall mud as noted below.

Fill in most of the holes or voids with setting-type drywall joint compound commonly called 'hot  mud' which is a chemically setting dry wall mud. The hot mud has a working time frame that is noted on the product bag. I suggest using 90 minute to give plenty of working time and there is not a lot of advantage in this case for using a shorter time. Be sure to use it within the set-time, there is no way to extend the time by adding more water.

We use this mud instead of regular type because it does not lose volume when drying and therefore will not crack or need additional layers for the deeper voids. A downside, which is also an upside in many cases, is that it is creates a much harder surface that will be hard to change later.

Use a putty knife to just below your desired surface level. Be careful not to allow high spots as it is difficult to sand down and not easy to remove.

Then apply a thin layer of finish type dry wall mud for a nice finished surface that can be lightly sanded if needed

Finally, apply a thin bean of painters caulk in the corner where the drywall meets the window frame, this will hide the wall/window interface where a crack might appear.