Should I use 12/3 NM cable for a 240 volt 40 amp electric cooktop?
Not even remotely close. You need 8 gauge copper or 6 gauge aluminum wire.

A 20 amp dual pole breaker supplies 20 amps at 240 volts (line to line), or 20 amps at 120 volts twice (line to neutral and line to neutral). You need a 40 amp at 240 volt breaker.

...and these two questions in combination strongly suggest that you get professional help before you cause yourself an expensive problem. Like the price of a new house expensive.