In a large mixing bowl beat butter or margarine with an electric mixer on medium speed for 30 seconds or until softened. Add sugar, cocoa powder, and baking powder; beat until combined. Beat in eggs. Beat in as much of the flour as you can. Using a wooden spoon, stir in any remaining flour.
Divide dough in half. On a lightly floured surface, shape each half into a 9-inch-long log. Place logs 5 inches apart on a lightly greased cookie sheet. Flatten logs until 2 inches wide.
Bake in a 375 degree F oven for 20 to 25 minutes or until a toothpick inserted near the center comes out clean. Cool on the cookie sheet on a wire rack for 1 hour. With a serrated knife, cut each log diagonally into 1/2-inch-thick slices. Lay slices, cut sides down, on an ungreased cookie sheet.
Bake slices in a 325 degree F oven for 8 minutes. Turn slices over. Bake 7 to 9 minutes more or until biscotti are dry and crisp (do not overbake). Cool thoroughly on a wire rack. If desired, melt chocolate or white baking pieces with shortening; drizzle over cooled cookies. Store biscotti in an airtight container at room temperature up to 1 week. Makes 32 slices.