My first question to you is: How long has your daughter been underachieving, and in how many subjects? If the behavior has been going on for a short time -- under six months -- and only in one or two subjects, you might want to talk to her teachers about changing the curriculum in some way to make it more engaging for her. If the behavior has been going on for a longer time and if she is underachieving in most or all of her subjects, you might want to think about some other possible approaches.
Assuming that difficulties such as substance abuse, learning disabilities, and other educational and medical problems such as ADHD have been ruled out, my first question about any child who is underachieving is what does the behavior mean? Often, children underachieve as a means of solving a problem. They may underachieve for attention, as a means of getting more free time, or because they are trying to fit in with their friends. Sometimes they underachieve to reduce pressure or to gain autonomy. So my advice to you is to look at the whole picture and try to understand what your daughter is getting out of underachieving. If you realize that she is underachieving to get free time to play guitar, the answer might be as simple as rearranging her schedule to find more time to pursue her music.
Another important strategy would be to have her learn more about her learning style. My current favorite book on this topic is Dr. Kathleen Butler's Learning Styles: Personal Exploration and Practical Applications
It also would be important to find opportunities for her to relate school topics to her areas of demonstrated interest, which will allow her to come to school-related projects from a position of strength and enthusiasm. Since you asked about her guitar lessons, I believe that taking them away until she turns in her homework would not be in your daughter's better interests, since that is the one area in which her interest in learning seems to be strong. In fact, I would try to use that interest as a key to stimulate learning in other subjects. For example, if she has an assignment in her American history class to write about an event in Colonial times, perhaps she could research the music from that era or compose a piece that reflects the mood of the country at that time.
Another problem to consider is perfectionism, which is rampant among gifted students. For many students, perfectionism becomes a positive force, a striving for excellence that drives their achievement. They are energized by their goals and challenged by high standards. Others, however, resort to underachievement as a means of dealing with their perfectionism. They feel that if they cannot do something perfectly, they might as well not do it at all.
If you realize that perfectionism is playing a significant role in your daughter's underachievement, you should try to help her figure out the source of the pressure. Perhaps you will need to adjust your expectations or how you communicate them. Maybe she needs to rethink her own goals and expectations. Or you may need to talk to a school counselor. An excellent book that you and your daughter might want to consider reading is Miriam Adderholdt-Elliot's Perfectionism: What's Bad about Being Too Good, which not only discusses the problem but offers possible solutions. Most important, however, is your own attitude toward mistakes -- hers, yours, and others' -- as you are her most valuable role model for this issue. She needs to learn that most mistakes are opportunities to learn new ways of solving problems, not roadblocks to stop trying! Pointing out mistakes that you made over the years and how you lived through and overcame them would be a tremendous help.
One other question to ask is whether or not your daughter is frustrated and upset about her underachievement. Does she want to change her behavior? If not, then it may be a very difficult problem to remedy and you may need to seek professional help. Especially at this age, change can only occur if the child is a willing participant. These are difficult issues, to be sure, but not unsolvable!