It's true that using PWM or a DAC you can make almost any waveform but have you consider that the maximum voltage you can produce from a 16F877 is 5V and without other circuitry, the maximum power it can produce is less than 1 Watt.
You don't have many options and none are very efficient unless you use a transformer:
Generate a square wave (you don't really need a PIC for that) at 12V and feed it to a voltage multiplier to step it up using a diode multiplier. Then take the output from a H-bridge configuration to allow the polarity to be reversed. You will have to use diodes with very low forward voltage drop at >20A forward current and they are hard to find. You may be able to find a Germanium type that can do it, good luck trying.
There are variations on that theme but all have the same problem of generating enough voltage. The idea of using a transformer is that you convert the power from low voltage to high voltage by converting high current to low current. I can't think of any other way of doing it efficiently at 300W load. Using the method I mentioned earlier, I expect efficiency to be less than 10% if it worked at all.
Brian.